
Last chance! 50% off unlimited learning
Sale ends in
Density, distribution function, quantile function, and random generation for the chi distribution.
dchi(x, df)
pchi(q, df)
qchi(p, df)
rchi(n, df)
vector of (positive) quantiles.
vector of (positive) quantiles.
vector of probabilities between 0 and 1.
sample size. If length(n)
is larger than 1, then length(n)
random values are returned.
vector of (positive) degrees of freedom (> 0). Non-integer values are allowed.
density (dchi
), probability (pchi
), quantile (qchi
), or
random sample (rchi
) for the chi distribution with df
degrees of freedom.
Elements of x
, q
, p
, or df
that are missing will
cause the corresponding elements of the result to be missing.
The chi distribution with
The chi density function is given by:
Forbes, C., M. Evans, N. Hastings, and B. Peacock. (2011). Statistical Distributions. Fourth Edition. John Wiley and Sons, Hoboken, NJ.
Johnson, N. L., S. Kotz, and N. Balakrishnan. (1995). Continuous Univariate Distributions, Volume 1. Second Edition. John Wiley and Sons, New York.
Chisquare, Normal, predIntNorm
,
Probability Distributions and Random Numbers.
# NOT RUN {
# Density of a chi distribution with 4 degrees of freedom, evaluated at 3:
dchi(3, 4)
#[1] 0.1499715
#----------
# The 95'th percentile of a chi distribution with 10 degrees of freedom:
qchi(.95, 10)
#[1] 4.278672
#----------
# The cumulative distribution function of a chi distribution with
# 5 degrees of freedom evaluated at 3:
pchi(3, 5)
#[1] 0.8909358
#----------
# A random sample of 2 numbers from a chi distribution with 7 degrees of freedom.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(20)
rchi(2, 7)
#[1] 3.271632 2.035179
# }
Run the code above in your browser using DataLab