1function L = moment_lah(n)
4% Triangle of
the Lah numbers L(i,j) = (i!/j!)*nchoosek(i-1,j-1), which link
5%
the factorial moments to
the upward-factorial moments. The triangle
is built
6% from
the equivalent recursion
8% L(i,j) = L(i-1,j-1) + (i+j-1)*L(i-1,j)
for j > 0
9% L(0,0) = 1, L(i,0) = 0
for i > 0
11% which avoids
the overflow of
the explicit factorial form
for large orders.
14% n: maximum order (n >= 0)
17% L: (n+1)x(n+1) matrix with L(i+1,j+1) = L(i,j) in
the 0-based notation of
18%
the reference. Entries with j > i are zero.
21% A. Heindl and A. van de Liefvoort. Moment conversions
for discrete
22% distributions. PMCCS, 2003, Section 4.
23% I. Lah. Eine neue Art von Zahlen, ihre Eigenschaften und Anwendung in der
24% mathematischen Statistik. Mitteilungsbl. Math. Statist., 7:203-212, 1955.
29if ~isscalar(n) || n < 0 || n ~= round(n)
30 line_error(mfilename,'The maximum order n must be a nonnegative integer.');
36 L(i+1,j+1) = L(i,j) + (i+j-1)*L(i,j+1);