distributions.ijs

Script: ~addons/finance/finexec/statistics/distributions.ijs
Contributor: William Szuch
Updated: 2023 03 17
Depend: plot
Definitions: loaded to locale base
Status: dev
Script source: distributions.ijs

Definitions for distribution functions:
Probability density function (pdf)
Cummualtive density function (cdf)

See stats functions from: ‘~addons/stats/base.ijs’
base.ijs loads complete set of base statistical verbs into locale z.

Equations:
To Do

Definitions

L lognormal_pdf
N normal_pdf
P poisson_pdf, polygon_cdf, polygon_pdf
X x_from_y
Y y_from_x

x_from_y v Interpolation of y onto x - disctete curve.
y_from_x v Interpolation of x onto y - disctete curve.

lognormal_pdf (verb)

Form: explici
Depend:nil
Lognormal pdf
X has distribution Normal(mean,stddev)
Y = exp(X) so that X = log(Y)
The pdf of Y is lognormal

Syntax

[M,S]lognormal_pdf(P)
   M = mean
   S = standard devation
   Default = (0,1)
   P = Point to calculate the value of the pdf

Example

  lognormal_pdf( 1 2)
0.398942 0.221853
 plot (steps 0.001 4 1000);(0,0.5)lognormal_pdf(steps 0.001 4 1000)

normal_pdf (verb)

Form: explici
Depend: nil
Normal pdf

Syntax

[M,S]normal_pdf(P)
   M = mean
   S = standard devation
 Default = (0,1)
   P = Point to calculate the value of the pdf

Example

   normal_pdf(_2 _1 0 1 2)
0.053991 0.241971 0.398942 0.241971 0.053991
  plot (steps _4 4 1000);normal_pdf(steps _4 4 1000)
  plot (steps _4 4 1000);(1,0.5)normal_pdf(steps _4 4 1000)

poisson_pdf (verb)

Poison pdf

polygon_cdf (verb)

synax:

polygon_pdf (verb)

Form: explicit
Depend:nil
Polygon pdf
Area under the polygon to be scaled to 1

Syntax

 (X;Y)polygon_pdf(P)