functiondensity
Density of discrete distribution (undefined!)
Extends from Modelica.Math.Distributions.Interfaces.partialTruncatedDensity (Common interface of truncated probability density functions).
Information
This function returns the probability density according to a discrete distribution in a band.
For more details of this distribution see Wikipedia.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | u (from partialDensity) | Random number over the real axis (-inf < u < inf) | |
| Real | u_min (from partialTruncatedDensity) | 0 | Lower limit of u |
| Real | u_max (from partialTruncatedDensity) | 1 | Upper limit of u |
| Real[:] | x | {0, 1} | Discrete values to be chosen from |
| Real[size(x, 1)] | p | ones(size(x, 1))/size(x, 1) | The probabilities of the discrete values |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | y (from partialDensity) | Density of u |