Learn R Programming

kStatistics (version 1.0)

powS: Power sums

Description

Given one or more lists of numbers, computes the value of the power sum symmetric polynomial with fixed degrees in one or more sets of variables plugged by the given numbers .

Usage

powS(vn,lvd)

Arguments

vn

array of powers (degrees)

lvd

list of numbers

Value

integer

value of the power sum symmetric polynomial

Details

Given the lists (x[1],x[2],...), (y[1],y[2],...), (z[1],z[2],...), ... in L and the integers (n,m,j,...) in vn powS( vn ,L ) returns (x[1]^n)*(y[1]^m)*(z[1]^j)*...+(x[2]^n)*(y[2]^m)*(z[2]^j)*+...See also the examples.

References

Di Nardo E., G. Guarino, D. Senato (2008) Symbolic computation of moments of sampling distributions. Comp. Stat. Data Analysis Vol. 52, no. 11, 4909--4922, (download from http://www.elviradinardo.it/lavori1.html)

Examples

Run this code
# NOT RUN {
powS(c(3), list(c(1),c(2),c(3))) 
# computes 1^3 + 2^3 + 3^3 = 36
    
powS(c(3,2),list(c(1,4),c(2,5),c(3,6))) 
# computes (1^3 * 4^2) + (2^3 * 5^2) + (3^3 * 6^2) = 1188

# }

Run the code above in your browser using DataLab