Description Usage Arguments Value Examples
View source: R/draw.noncentral.chisquared.R
This function implements pseudo-random number generation for a non-central chi-squared distribution with pdf
f(x|λ,ν)=\frac{e^{-(x+λ)/2}x^{ν/2-1}}{2^{ν/2}} ∑_{k=0}^{∞} \frac{(λ x)^{k}}{4^{k}k!Γ(k+ν/2)}
for 0 ≤q x < ∞, λ>0, and ν>1, where λ is the non-centrality parameter and ν is the degrees of freedom.
1 | draw.noncentral.chisquared(nrep,dof,ncp)
|
nrep |
Number of data points to generate. |
dof |
Degrees of freedom of the desired non-central chi-squared distribution. |
ncp |
Non-centrality parameter of the desired non-central chi-squared distribution. |
A list of length five containing generated data, the theoretical mean, the empirical mean, the theoretical variance, and the empirical variance with names y, theo.mean, emp.mean, theo.var, and emp.var, respectively.
1 2 3 | draw.noncentral.chisquared(nrep=100000,dof=2,ncp=1)
draw.noncentral.chisquared(nrep=100000,dof=5,ncp=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.