functionnormalizationConstant
Calculate the normalization constant for a distribution given by a piecewise linear density function
Extends from ICON ((Weighted) geometric mean).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The output y is the area under a piecewise linear probability distribution function specified by a list of points p1, p2, ... pn.
Syntax
Functions.normalizationConstant({{x1,y1},{x2,y2}, ...});
Implementation
y := 0.0; for i in 1:n - 1 loop y := y + areaLineSegment(plPDF[i], plPDF[i + 1]); end for;
Examples
normalizationConstant({{1,1},{2,2}}); // 1.5
normalizationConstant({{0,1},{10,1}}); // 10.0
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x (from geometricMean) | Vector input | |
| Real | weights (from geometricMean) | ones(size(x, 1)) | Vector of weights |
| Real | plPDF | Piecewise linear probability density function, i.e., { p1, p2, ... } |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | y (from geometricMean) |
Revisions
- Introduced in v2.1.0.
- Robustified the implementation in v2.2.