cf_Conv | R Documentation |
cf_Conv(t, cfX, coef, n)
computes the characteristic function of a linear combination
(convolution) of iid random variables X
with given (common) characteristic function cfX(t)
and the coefficients coef, and such that Y = coef(1)*X + ... + coef(N)*X
,
i.e. cf = cfX(coef(1)*t) * ... * cfX(coef(N)*t)
.
If or all coef == 1
, then cf = cfX(t)^N
, . Moreover, with using the optional parameter n
,
the algorithm evaluates CF of the convolution of n
independent copies of the random variable Y
,
i.e. Z = Y + ... + Y
, where Y = coef(1)*X + ... + coef(N)*X
,
i.e. cf = (cfX(coef(1)*t) * ... * cfX(coef(N)*t))^n
.
cf_Conv(t, cfX, coef, n)
t |
vector (or array) of input values |
cfX |
function handle to the given chracteristic function |
coef |
vector of coeficients of the linear combination of the iid random variables,
such that |
n |
optional power coeficient of additional convolution of the combiend CF of |
The characteristic function of a linear combination of iid RVs with characteristic function cf
,
evaluated at t
.
Ver.: 06-Oct-2018 18:14:22 (consistent with Matlab CharFunTool v1.3.0, 9-May-2017 10:22:48).
Other CF Tool:
cfX_PDF()
## EXAMPLE 1
# CF of a linear combination of chi-square random variables
df <- 1
cfX <- function(t) cfX_ChiSquare(t, df)
coef <- 1 / (1:100)
cf <- function(t) cf_Conv(t, cfX, coef)
t <- seq(-10, 10, length.out = 501)
plotReIm(cf, t, title = 'CF of a Linear Combination of iid Chi-Square RVs')
options <- list()
options$xMin <- 0
result <- cf2DistGP(cf, options = options)
## EXAMPLE 2
# CF of a linear combination of iid RVs sampled from the empirical
# distribution function (atrtificially generated data)
n <- 30
p <- c(0.2, 0.7, 0.1)
data <- p[1] * rchisq(n, 5) + p[2] * rnorm(n, 10, 1) + p[3] * rt(n, 1)
cfE <- function(t) cfE_Empirical(t, data)
coef <- 1 / c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
cf <- function(t) cf_Conv(t, cfE, coef)
t <- seq(-10, 10, length.out = 501)
plotReIm(cf, t, title = 'CF of a Linear Combination of iid RVs')
result <- cf2DistGP(cf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.