ikr.simlib.distributions.discrete.transform

## Class DiscreteTransformedDistribution

• All Implemented Interfaces:
ReflectionConstructable, ReflectionConstructable3<SimNode,Parameters,RandomNumberGenerator>

public class DiscreteTransformedDistribution
extends DiscreteDistribution
Linear Transformed Continuous Distribution
Meaning: Parameters: Distribution of a discrete random variable $$X$$, that results from a linear transformation $$X = aY + b$$ of the random variable $$Y$$ with a given discrete distribution ("base distribution"). base distribution $$q_i$$ integer number factor $$a \neq 0$$ integer number offset $$b$$ Distribution: $$P(X=i) = p_i = \begin{cases} q_j &\mbox{for } i=aj+b, j=0,1,... \\ 0 &\mbox{else} \end{cases}$$ $$E[X] = a \cdot E[Y] +b$$ $$VAR[X]= a^2 \cdot VAR[Y]$$ $$c_T = \frac{1}{\frac{1}{c_z} + \frac{b}{a \sqrt{VAR[Y]}}}$$  [...].Distribution = DiscreteTransformedDistribution [...].Distribution.BaseDist = Geometric [...].Distribution.BaseDist.Mean = 2.5 [...].Distribution.Factor = 2 # optional, default = 1 [...].Distribution.Offset = 1 # optional, default = 0 
• ### Field Summary

Fields
Modifier and Type Field and Description
DiscreteDistribution baseDist
int factor
int offset
• ### Fields inherited from class ikr.simlib.distributions.Distribution

rng
• ### Fields inherited from interface ikr.simlib.parameters.reflection.ReflectionConstructable

CREATE_INSTANCE_METHOD_NAME
• ### Constructor Summary

Constructors
Constructor and Description
DiscreteTransformedDistribution(DiscreteDistribution baseDist)
DiscreteTransformedDistribution(DiscreteDistribution baseDist, int offset)
DiscreteTransformedDistribution(DiscreteDistribution baseDist, int offset, int factor)
• ### Method Summary

Methods
Modifier and Type Method and Description
static DiscreteTransformedDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
int next()
Create random numbers
• ### Methods inherited from class ikr.simlib.distributions.Distribution

getDefaultRNG, getRandomNumberGenerator, reset
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### baseDist

public final DiscreteDistribution baseDist
• #### offset

public final int offset
• #### factor

public final int factor
• ### Constructor Detail

• #### DiscreteTransformedDistribution

public DiscreteTransformedDistribution(DiscreteDistribution baseDist,
int offset,
int factor)
• #### DiscreteTransformedDistribution

public DiscreteTransformedDistribution(DiscreteDistribution baseDist,
int offset)
• #### DiscreteTransformedDistribution

public DiscreteTransformedDistribution(DiscreteDistribution baseDist)
• ### Method Detail

• #### createInstance

public static DiscreteTransformedDistribution createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
• #### next

public int next()
Description copied from class: DiscreteDistribution
Create random numbers
Specified by:
next in class DiscreteDistribution