Post Reply 
Distributions
03-01-2015, 05:05 PM
Post: #10
RE: Distributions
n-Erlang distribution (see also Gamma and exponential)

Code:

EXPORT erlang(k,l,n)
// n-Erlang distribution k shape parameter, l=λ >=0 rate parameter
// from Gamma d.; if k=1 -> erlang(1,l,n) = exponential(l,n)
// erlang(k,λ) = gamma(k,1/λ)
BEGIN
local f;
f:=piecewise(n<0,0, l<0, 0, ((l^k)*(n^(k-1)*e^(-l*n)))/(k-1)! );
END;

EXPORT erlang2(k, m, n)
//k shape parameter,  m=μ=1/λ >=0 scale parameter
// if μ=2 -> chi2 with 2k degree of freedom
BEGIN
local f;
f:=piecewise(n<0,0, m<0, 0, (n^(k-1)*e^(-n/m))/((m^k)*(k-1)!));
END;

EXPORT erlang_cdf(k, l, n)
// k shape parameter, l=λ >=0 rate parameter (μ=1/λ)
BEGIN
local f;
f:= 1- sum((1/X!)*(e^(-l*n))*(l*n)^X,X,0,k-1);
END;

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Distributions - salvomic - 02-18-2015, 11:10 PM
RE: Distributions - walter b - 02-19-2015, 06:18 AM
RE: Distributions - parisse - 02-19-2015, 07:35 AM
RE: Distributions - salvomic - 02-19-2015, 08:28 AM
RE: Distributions - Offroad - 02-19-2015, 11:58 AM
RE: Distributions - salvomic - 02-19-2015, 12:38 PM
RE: Distributions - salvomic - 02-19-2015, 03:58 PM
RE: Distributions - salvomic - 02-19-2015, 08:27 PM
RE: Distributions - salvomic - 02-22-2015, 06:49 PM
RE: Distributions - salvomic - 03-01-2015 05:05 PM
RE: Distributions - salvomic - 03-04-2015, 02:37 PM
RE: Distributions - salvomic - 04-08-2015, 11:00 AM
RE: Distributions - DrD - 04-08-2015, 01:22 PM
RE: Distributions - salvomic - 04-08-2015, 01:37 PM
RE: Distributions - Claudio L. - 04-08-2015, 10:04 PM
RE: Distributions - salvomic - 04-09-2015, 04:35 AM
RE: Distributions - Gerald H - 04-09-2015, 09:34 AM
RE: Distributions - Paul Dale - 04-08-2015, 09:33 PM
RE: Distributions - debrouxl - 04-09-2015, 05:53 PM



User(s) browsing this thread: 6 Guest(s)