## Types in MathNet.Numerics.Distributions

Type Laplace

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

Continuous Univariate Laplace distribution. The Laplace distribution is a distribution over the real numbers parameterized by a mean and scale parameter. The PDF is: p(x) = \frac{1}{2 * scale} \exp{- |x - mean| / scale}..

### Public Constructors

#### Laplace(double location, double scale, Random randomSource)

Initializes a new instance of the Laplace class.
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

###### Random randomSource

The random number generator which is used to draw random samples.

#### Laplace()

Initializes a new instance of the Laplace class (location = 0, scale = 1).

#### Laplace(double location, double scale)

Initializes a new instance of the Laplace class.
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

### Public Static Functions

#### doubleCDF(double location, double scale, double x)

Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

###### double x

The location at which to compute the cumulative distribution function.

##### Return
###### double

the cumulative distribution at location x.

#### boolIsValidParameterSet(double location, double scale)

Tests whether the provided values are valid parameters for this distribution.
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

#### doublePDF(double location, double scale, double x)

Computes the probability density of the distribution (PDF) at x, i.e. ∂P(X ≤ x)/∂x.
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

###### double x

The location at which to compute the density.

##### Return
###### double

the density at x.

#### doublePDFLn(double location, double scale, double x)

Computes the log probability density of the distribution (lnPDF) at x, i.e. ln(∂P(X ≤ x)/∂x).
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

###### double x

The location at which to compute the density.

##### Return
###### double

the log density at x.

#### doubleSample(double location, double scale)

Generates a sample from the distribution.
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

##### Return
###### double

a sample from the distribution.

#### doubleSample(Random rnd, double location, double scale)

Generates a sample from the distribution.
##### Parameters
###### Random rnd

The random number generator to use.

###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

##### Return
###### double

a sample from the distribution.

#### IEnumerable<double>Samples(double location, double scale)

Generates a sequence of samples from the distribution.
##### Parameters
###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

##### Return
###### IEnumerable<double>

a sequence of samples from the distribution.

#### voidSamples(Double[] values, double location, double scale)

Fills an array with samples generated from the distribution.
##### Parameters
###### Double[] values

The array to fill with the samples.

###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

##### Return
###### void

a sequence of samples from the distribution.

#### IEnumerable<double>Samples(Random rnd, double location, double scale)

Generates a sequence of samples from the distribution.
##### Parameters
###### Random rnd

The random number generator to use.

###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

##### Return
###### IEnumerable<double>

a sequence of samples from the distribution.

#### voidSamples(Random rnd, Double[] values, double location, double scale)

Fills an array with samples generated from the distribution.
##### Parameters
###### Random rnd

The random number generator to use.

###### Double[] values

The array to fill with the samples.

###### double location

The location (μ) of the distribution.

###### double scale

The scale (b) of the distribution. Range: b > 0.

##### Return
###### void

a sequence of samples from the distribution.

### Public Methods

#### doubleCumulativeDistribution(double x)

Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
##### Parameters
###### double x

The location at which to compute the cumulative distribution function.

##### Return
###### double

the cumulative distribution at location x.

#### doubleDensity(double x)

Computes the probability density of the distribution (PDF) at x, i.e. ∂P(X ≤ x)/∂x.
##### Parameters
###### double x

The location at which to compute the density.

##### Return
###### double

the density at x.

#### doubleDensityLn(double x)

Computes the log probability density of the distribution (lnPDF) at x, i.e. ln(∂P(X ≤ x)/∂x).
##### Parameters
###### double x

The location at which to compute the log density.

##### Return
###### double

the log density at x.

#### doubleSample()

Samples a Laplace distributed random variable.
##### Return
###### double

a sample from the distribution.

#### IEnumerable<double>Samples()

Generates a sample from the Laplace distribution.
##### Return
###### IEnumerable<double>

a sample from the distribution.

#### voidSamples(Double[] values)

Fills an array with samples generated from the distribution.

#### stringToString()

A string representation of the distribution.
##### Return
###### string

a string representation of the distribution.

### Public Properties

#### doubleEntropy get;

Gets the entropy of the distribution.

#### doubleLocation get;

Gets the location (μ) of the Laplace distribution.

#### doubleMaximum get;

Gets the maximum of the distribution.

#### doubleMean get;

Gets the mean of the distribution.

#### doubleMedian get;

Gets the median of the distribution.

#### doubleMinimum get;

Gets the minimum of the distribution.

#### doubleMode get;

Gets the mode of the distribution.

#### RandomRandomSource get; set;

Gets or sets the random number generator which is used to draw random samples.

#### doubleScale get;

Gets the scale (b) of the Laplace distribution. Range: b > 0.

#### doubleSkewness get;

Gets the skewness of the distribution.

#### doubleStdDev get;

Gets the standard deviation of the distribution.

#### doubleVariance get;

Gets the variance of the distribution.