nl.tudelft.simulation.jstats.distributions
Class DistDiscreteEmpirical

java.lang.Object
  extended by nl.tudelft.simulation.jstats.distributions.Dist
      extended by nl.tudelft.simulation.jstats.distributions.DistDiscrete
          extended by nl.tudelft.simulation.jstats.distributions.DistDiscreteEmpirical
All Implemented Interfaces:
Serializable

public class DistDiscreteEmpirical
extends DistDiscrete

The discrete empirical distribution as defined on page 326 of Law&Kelton.

(c) copyright 2002-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:42 $
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
 
Fields inherited from class nl.tudelft.simulation.jstats.distributions.Dist
stream
 
Constructor Summary
DistDiscreteEmpirical(StreamInterface stream, long[] observations)
          constructs a new DistDiscreteEmpirical distribution.
DistDiscreteEmpirical(StreamInterface stream, Long[] observations)
          constructs a new DistDiscreteEmpirical distribution.
DistDiscreteEmpirical(StreamInterface stream, ObservationsInterface observations)
          constructs a new DistDiscreteEmpirical distribution.
DistDiscreteEmpirical(StreamInterface stream, SortedMap observations, boolean cummulative)
          constructs a new DistDiscreteEmpirical distribution.
 
Method Summary
 long draw()
          draws the next long from the stream.
 double probability(int observation)
          returns the propbability of the observation in this particular distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistDiscreteEmpirical

public DistDiscreteEmpirical(StreamInterface stream,
                             ObservationsInterface observations)
constructs a new DistDiscreteEmpirical distribution.

Parameters:
stream - the stream to use
observations - the observations feeding the distributions. These observations should be in one of two possible formats. The first accepted format is the X(i);probability format. This results in a map with values such as 1=0.33;2=0.167;3=0.167;4=0.33. The second allowed format is the X(i);occurrence combination resulting in values such as 1=2;2=1;3=1;4=2.

DistDiscreteEmpirical

public DistDiscreteEmpirical(StreamInterface stream,
                             Long[] observations)
constructs a new DistDiscreteEmpirical distribution.

Parameters:
stream - the stream to use
observations - the observations feeding the distributions. This sortedmap should be filled with observation probability values. The probability may either reflect the number of times this observation is observed or may contain a relative probability.

DistDiscreteEmpirical

public DistDiscreteEmpirical(StreamInterface stream,
                             long[] observations)
constructs a new DistDiscreteEmpirical distribution.

Parameters:
stream - the stream to use
observations - the observations feeding the distributions. This sortedmap should be filled with observation probability values. The probability may either reflect the number of times this observation is observed or may contain a relative probability.

DistDiscreteEmpirical

public DistDiscreteEmpirical(StreamInterface stream,
                             SortedMap observations,
                             boolean cummulative)
constructs a new DistDiscreteEmpirical distribution.

Parameters:
stream - the stream to use
observations - the observations feeding the distributions. This sortedmap should be filled with observation probability values. The probability may either reflect the number of times this observation is observed or may contain a relative probability.
cummulative - reflects whether the probabilities are cummulative
Method Detail

draw

public long draw()
Description copied from class: DistDiscrete
draws the next long from the stream.

Specified by:
draw in class DistDiscrete
Returns:
long
See Also:
DistDiscrete.draw()

probability

public double probability(int observation)
Description copied from class: DistDiscrete
returns the propbability of the observation in this particular distribution.

Specified by:
probability in class DistDiscrete
Parameters:
observation - the discrete observation.
Returns:
double the probability.
See Also:
DistDiscrete.probability(int)


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.