k1fun {PPMiss} | R Documentation |
Constant K1
Description
Calculates an estimate for the constant given by
where ,
is such that
(the product copula), and
is a sequence of absolutely continuous distribution
functions.
Usage
k1fun(dCdtheta, fun, data, empirical, mean = 0, sd = 1)
Arguments
dCdtheta |
a function providing the limit as |
fun |
optionally, a function providing an estimator for the probability density function. |
data |
the observed time series. Only used to obtain the quantile function
when |
empirical |
logical. If |
mean |
the mean of the gaussian distribution.
Only used if |
sd |
the standard deviation of the gaussian distribution.
Only used if |
Details
Here and
are replaced by sample estimators for these
functions or the gaussian density and quantile functions are used, depending
on the context.
The function kdens
is used as sample estimator of and
quantile
is the sample estimator of .
Value
The value of .
Examples
trunc = 50000
cks <- arfima.coefs(d = 0.25, trunc = trunc)
eps <- rnorm(trunc+1000)
x <- sapply(1:1000, function(t) sum(cks*rev(eps[t:(t+trunc)])))
# kernel density function
dfun <- kdens(x)
# calculating K1 using four copulas and empirical estimates for F' and F^{(-1)}
K1_frank_e <- k1fun(dCdtheta = dCtheta_frank, fun = dfun,
data = x, empirical = TRUE)
K1_amh_e <- k1fun(dCdtheta = dCtheta_amh, fun = dfun,
data = x, empirical = TRUE)
K1_fgm_e <- k1fun(dCdtheta = dCtheta_fgm, fun = dfun,
data = x, empirical = TRUE)
K1_gauss_e <- k1fun(dCdtheta = dCtheta_gauss, fun = dfun,
data = x, empirical = TRUE)
# calculating K1 using four copulas and gaussian marginals
K1_frank_g <- k1fun(dCdtheta = dCtheta_frank, fun = NULL, data = NULL,
empirical = FALSE, mean = mean(x), sd = sd(x))
K1_amh_g <- k1fun(dCdtheta = dCtheta_amh, fun = NULL, data = NULL,
empirical = FALSE, mean = mean(x), sd = sd(x))
K1_fgm_g <- k1fun(dCdtheta = dCtheta_fgm, fun = NULL, data = NULL,
empirical = FALSE, mean = mean(x), sd = sd(x))
K1_gauss_g <- k1fun(dCdtheta = dCtheta_gauss, fun = NULL, data = NULL,
empirical = FALSE, mean = mean(x), sd = sd(x))
# comparing results
data.frame(MARGINAL = c("Empirical", "Gaussian"),
FRANK = c(K1_frank_e, K1_frank_g),
AMH = c(K1_amh_e, K1_amh_g),
FGM = c(K1_fgm_e, K1_fgm_g),
GAUSS = c(K1_gauss_e, K1_gauss_g))