Description Usage Arguments Details Value References See Also Examples
Returns a matrix of Stirling numbers of the first kind
1 | stirmat(n, m)
|
n |
The first parameter for Stirling numbers |
m |
The second parameter for Stirling numbers |
Stirling numbers of the first (and second) kind are useful numbers for combinatorics. In the context of sequence analysis, Stirling numbers of the first kind have entered into the calculation of statistics that measure expected numbers of alleles in a population.
Stirling numbers are characterized by two parameters, 'n' and 'm' (or 'n' and 'k' in some literature). 'stirmat' returns an n by m matrix of all the respective Stirling numbers using a recursion relationship.
‘stirmat' is a direct port of the code from James Cai’s PGEToolbox, which was originally written for Matlab.
A matrix with n rows and m columns, the elements of which are Stirling numbers of the first kind, for all combinations of n and m up to the supplied n and m and column, respectively
Cai, J.J. (2008) PGEToolsbox: A Matlab toolbox for population genetics and evolution. J Hered 99(4):438-40
'lstirling' for a logarithmic estimator of large Stirling numbers
1 2 3 4 5 | n <- 20
m <- 10
stirling_matrix <- stirmat(n, m)
stirling_matrix[n,m]
# 3.819221e+14
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.