Class LogNormalDistributionParameter
java.lang.Object
it.univr.di.cstnu.util.LogNormalDistributionParameter
- All Implemented Interfaces:
Serializable
Log-normal distribution. Initially created inside PSTN class. Then, extracted to allow the compilation of the package without class PSTN.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLogNormalDistributionParameter
(double location, double scale) LogNormalDistributionParameter
(double location, double scale, int shift) -
Method Summary
-
Constructor Details
-
LogNormalDistributionParameter
public LogNormalDistributionParameter(double location, double scale, int shift) - Parameters:
location
- Considering the associated normal distribution, this is the mean μ of the normal distribution.scale
- Considering the associated normal distribution, this is the std.dev. σ of the normal distribution.shift
- It is possible that the activation time point is shifted by a rigid distance. In such a case, the log-normal distribution of the contingent link is the same, but the sample values must be simply added to the shift to have a right value. It would be possible to adjust the location and scale of the log-normal distribution to incorporate such a shift, but we verified that such an adjustment introduce some approximation errors. Be careful: if the original pdf was for the contingent link X --v--> A===>C and A was moved to X, the range of contingent link is increased by v. The shift is 'v', not (-v). Shift can be only positive.
-
LogNormalDistributionParameter
public LogNormalDistributionParameter(double location, double scale) - Parameters:
location
- Considering the associated normal distribution, this is the mean μ of the normal distribution.scale
- Considering the associated normal distribution, this is the std.dev. σ of the normal distribution.
-
-
Method Details
-
parse
- Parameters:
input
- atoString()
representation of a LogNormalDistributionParameter object.
Format is "LogNormalDistributionParameter[location=%f, scale=%f, shift=%d]"- Returns:
- the LogNormalDistributionParameter object represented in the input, null otherwise.
-
cumulativeProbability
public double cumulativeProbability(double x) - Parameters:
x
- value in the domain (it will compensate by -shift)- Returns:
- the cumulative probability at x.
-
getLocation
public double getLocation()- Returns:
- location
-
getLogNormalDistribution
public org.apache.commons.math3.distribution.LogNormalDistribution getLogNormalDistribution()- Returns:
- the associated pdf
-
getScale
public double getScale()- Returns:
- the scale
-
getShift
public int getShift()- Returns:
- the shift
-
setShift
public void setShift(int shift) Registers shift.- Parameters:
shift
- the shift of the location parameter.
-
sample
public double sample()- Returns:
- a random value sampled by the current log-normal distribution adjusted by shift value.
-
toString
-