IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Represents a log-normal distribution. More...
Public Member Functions | |||
LognormalDistribution (double mu, double sigma) | |||
Initializes a log-normal distribution. More... | |||
LognormalDistribution () | |||
Initializes a standard log-normal distribution. More... | |||
override double | ProbabilityDensity (double x) | ||
Returns the probability density at the given point.
| |||
override double | LeftProbability (double x) | ||
Returns the cumulative probability to the left of (below) the given point.
| |||
override double | RightProbability (double x) | ||
Return the cumulative probability to the right of (above) the given point.
| |||
override double | InverseLeftProbability (double P) | ||
Returns the point at which the cumulative distribution function attains a given value.
| |||
override double | InverseRightProbability (double Q) | ||
Returns the point at which the right probability function attains the given value.
| |||
override double | GetRandomValue (Random rng) | ||
Returns a random value.
| |||
override double | Moment (int n) | ||
Computes a raw moment of the distribution.
| |||
override double | MomentAboutMean (int n) | ||
Computes a central moment of the distribution.
| |||
![]() | |||
virtual double | ExpectationValue (Func< double, double > f) | ||
Computes the expectation value of the given function. More... | |||
![]() | |||
virtual double | Cumulant (int r) | ||
Computes a cumulant of the distribution. More... | |||
Static Public Member Functions | |
static FitResult | FitToSample (Sample sample) |
Computes the log-normal distribution that best fits the given sample. More... | |
Properties | |
double | Mu [get] |
Gets the value of the μ parameter. More... | |
double | Sigma [get] |
Gets the value of the σ parameter. More... | |
override double | Mean [get] |
override double | Median [get] |
override double | Variance [get] |
override double | Skewness [get] |
override double | ExcessKurtosis [get] |
override Interval | Support [get] |
![]() | |
virtual double | Median [get] |
Gets the median of the distribution. More... | |
virtual Interval | Support [get] |
Gets the interval over which the distribution is nonvanishing. More... | |
![]() | |
virtual double | Mean [get] |
Gets the mean of the distribution. More... | |
virtual double | Variance [get] |
Gets the variance of the distribution. More... | |
virtual double | StandardDeviation [get] |
Gets the standard deviation of the distribution. More... | |
virtual double | Skewness [get] |
Gets the skewness of the distribution. More... | |
virtual double | ExcessKurtosis [get] |
Gets the excess kurtosis of the distribution. More... | |
Private Member Functions | |
double[] IParameterizedDistribution. | GetParameters () |
Gets the parameter values of the distribution. More... | |
void IParameterizedDistribution. | SetParameters (IList< double > parameters) |
Sets the parameter values of the distribution. More... | |
double IParameterizedDistribution. | Likelihood (double x) |
Gets the likelihood of a value, given the current parameters. More... | |
Private Attributes | |
double | mu = 0.0 |
double | sigma = 1.0 |
NormalDistribution | normal |
Represents a log-normal distribution.
The logrithm of a log-normal distributed variable is distributed normally.
The log-normal distribution is commonly used in financial engineering as a model of stock prices. If the rate of return on an asset is distributed normally, then its price will be distributed log-normally.
|
inline |
Initializes a log-normal distribution.
mu | The mean of the underlying normal distribution. |
sigma | The standard deviation of the underlying normal distribution. |
Note that the values of μ and σ parameters are not the mean and standard deviation of the log-normal distribution. They are the mean and standard deviation of their logrithms z = ln x. This is the standard method of characterizing a log-normal distribution.
|
inline |
Initializes a standard log-normal distribution.
A standard log-normal distribution has μ = 0 and σ = 1. It is the log transform of the standard normal distribution.
|
inlinevirtual |
Returns the probability density at the given point.
x | The reference point. |
Implements Meta.Numerics.Statistics.Distributions.Distribution.
|
inlinevirtual |
Returns the cumulative probability to the left of (below) the given point.
x | The reference point. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.Statistics.Distributions.NormalDistribution.LeftProbability().
|
inlinevirtual |
Return the cumulative probability to the right of (above) the given point.
x | The reference point. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.Statistics.Distributions.NormalDistribution.RightProbability().
|
inlinevirtual |
Returns the point at which the cumulative distribution function attains a given value.
P | The left cumulative probability P, which must lie between 0 and 1. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.Statistics.Distributions.NormalDistribution.InverseLeftProbability().
|
inlinevirtual |
Returns the point at which the right probability function attains the given value.
Q | The right cumulative probability, which must lie between 0 and 1. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.Statistics.Distributions.NormalDistribution.InverseRightProbability().
|
inlinevirtual |
Returns a random value.
rng | A random number generator. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.Statistics.Distributions.NormalDistribution.GetRandomValue().
|
inlinevirtual |
Computes a raw moment of the distribution.
r | The order of the moment to compute. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.MoreMath.Sqr().
|
inlinevirtual |
Computes a central moment of the distribution.
r | The order of the moment to compute. |
Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.
References Meta.Numerics.Functions.AdvancedIntegerMath.BinomialCoefficient(), and Meta.Numerics.MoreMath.Sqr().
|
inlinestatic |
Computes the log-normal distribution that best fits the given sample.
sample | The sample to fit. |
The returned fit parameters are the μ (Mu) and σ (Sigma) parameters, in that order. These are the same parameters, in the same order, that are required by the LognormalDistribution(double,double) constructor to specify a new log-normal distribution.
ArgumentNullException | sample is null. |
InsufficientDataException | sample contains fewer than three values. |
InvalidOperationException | sample contains non-positive values. |
References Meta.Numerics.Statistics.Sample.Count.
Referenced by Test.SampleTest.LognormalFit().
|
inlineprivate |
Gets the parameter values of the distribution.
Implements Meta.Numerics.Statistics.Distributions.IParameterizedDistribution.
|
inlineprivate |
Sets the parameter values of the distribution.
parameters | A list of parameter values. |
Implements Meta.Numerics.Statistics.Distributions.IParameterizedDistribution.
|
inlineprivate |
Gets the likelihood of a value, given the current parameters.
x | The value. |
Implements Meta.Numerics.Statistics.Distributions.IParameterizedDistribution.
|
private |
|
private |
|
private |
|
get |
Gets the value of the μ parameter.
Note that the value of this parameter is not the mean of the distribution. It is the value given to the distribution constructor (LognormalDistribution(double,double)), which is the mean of the underlying normal distribution.
Referenced by Test.SampleTest.LognormalFit().
|
get |
Gets the value of the σ parameter.
Note that the value of this parameter is not the standard deviation of the distribution. It is the value given to the distribution constructor (LognormalDistribution(double,double)), which is the sandard deviation of the underlying normal distribution.
Referenced by Test.SampleTest.LognormalFit().
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |