cf_ChiSquare | R Documentation |
cf_ChiSquare(t, df, ncp, coef, niid)
evaluates the characteristic function cf(t)
of a linear combination (resp.convolution)
of independent (possibly non-central) CHI-SQUARE random variables.
That is, cf_ChiSquare
evaluates the characteristic function cf(t)
of Y = sum_{i=1}^N coef_i * X_i
, where X_i ~ ChiSquare(df_i,ncp_i)
are inedependent RVs, with df_i > 0
degrees of freedom the 'non-centrality'
parameters ncp_i > 0
, for i = 1,...,N
.
The characteristic function of Y
is defined by
cf(t) = Prod ( (1-2*i*t*coef(i))^(-df(i)/2) * exp((i*t*ncp(i))/(1-2*i*t*coef(i))) ).
cf_ChiSquare(t, df, ncp, coef, niid)
t |
vector or array of real values, where the CF is evaluated. |
df |
the degrees of freedom parameter |
ncp |
the non-centrality parameter |
coef |
vector of the coefficients of the linear combination
of the chi-squared random variables. If coef is scalar,
it is assumed that all coefficients are equal. If empty, default value is |
niid |
scalar convolution coeficient |
Characteristic function cf(t)
of a linear combination of independent CHI-SQUARE random variables.
Ver.: 16-Sep-2018 18:16:32 (consistent with Matlab CharFunTool v1.3.0, 10-May-2017 18:11:50).
IMHOF J. (1961): Computing the distribution of quadratic forms in normal variables. Biometrika 48, 419-426.
For more details see WIKIPEDIA:
https://en.wikipedia.org/wiki/Chi-squared_distribution,
https://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution.
Other Continuous Probability Distribution:
cfS_Arcsine()
,
cfS_Beta()
,
cfS_Gaussian()
,
cfS_Laplace()
,
cfS_Rectangular()
,
cfS_Student()
,
cfS_TSP()
,
cfS_Trapezoidal()
,
cfS_Triangular()
,
cfS_Wigner()
,
cfX_ChiSquare()
,
cfX_Exponential()
,
cfX_FisherSnedecor()
,
cfX_Gamma()
,
cfX_InverseGamma()
,
cfX_LogNormal()
,
cf_ArcsineSymmetric()
,
cf_BetaNC()
,
cf_BetaSymmetric()
,
cf_Beta()
,
cf_Exponential()
,
cf_FisherSnedecorNC()
,
cf_FisherSnedecor()
,
cf_Gamma()
,
cf_InverseGamma()
,
cf_Laplace()
,
cf_LogRV_BetaNC()
,
cf_LogRV_Beta()
,
cf_LogRV_ChiSquareNC()
,
cf_LogRV_ChiSquare()
,
cf_LogRV_FisherSnedecorNC()
,
cf_LogRV_FisherSnedecor()
,
cf_LogRV_MeansRatioW()
,
cf_LogRV_MeansRatio()
,
cf_LogRV_WilksLambdaNC()
,
cf_LogRV_WilksLambda()
,
cf_Normal()
,
cf_RectangularSymmetric()
,
cf_Student()
,
cf_TSPSymmetric()
,
cf_TrapezoidalSymmetric()
,
cf_TriangularSymmetric()
,
cf_vonMises()
## EXAMPLE 1
# CF of the distribution of ChiSquare RV with DF = 1, NCP = 1
df <- 1
ncp <- 1
coef <- 1
t <- seq(from = -100,
to = 100,
length.out = 501)
plotReIm(
function(t)
cf_ChiSquare(t, df, ncp, coef),
t,
title = expression('Characteristic function of the' ~ chi ^ 2 ~ 'RV with DF=1 and NCP=1')
)
## EXAMPLE 2
# CF of a linear combination of K=100 independent ChiSquare RVs
coef <- 1 / (((1:50) - 0.5) * pi) ^ 2
plot(
1:50,
coef,
xlab = "",
ylab = "",
type = "p",
pch = 20,
col = "blue",
cex = 1,
main = expression('Coefficients of the linear combination of' ~ chi ^ 2 ~ 'RVs with DF=1')
)
lines(1:50, coef, col = "blue")
df <- 1
t <- seq(from = -100,
to = 100,
length.out = 501)
plotReIm(
function(t)
cf_ChiSquare(t = t, df = df, coef = coef),
t,
title = expression('CF of the linear combination of' ~ chi ^ 2 ~ 'RVs with DF=1')
)
## EXAMPLE 3
# PDF/CDF from the CF by cf2DistGP
df <- 1
coef <- 1 / (((1:50) - 0.5) * pi) ^ 2
cf <- function(t)
cf_ChiSquare(t = t, df = df, coef = coef)
options <- list()
options$N <- 2 ^ 12
options$xMin <- 0
x <- seq(from = 0,
to = 3.5,
length.out = 501)
prob <- c(0.9, 0.95, 0.975, 0.99)
result <- cf2DistGP(cf, x, prob, options)
result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.