d.fit {PPMiss} | R Documentation |
Long memory parameter estimation
Description
Let \theta_h
be the copula parameter associated to
(X_t,X_{t+h})
and \hat\theta_h
be an estimate of \theta_h
based on pseudo observations. The long memory parameter
d
is estimated by
\hat d:=\mathrm{argmin}_{|d|<0.5}\bigg\{\sum_{h=s}^m \bigg|{\hat K_1}(\hat\theta_h-a)-\frac{\Gamma(1-d)}{\Gamma(d)}h^{2d-1}\bigg|^r\bigg\}, \quad r > 0
.
Usage
d.fit(xt, copula = gauss, dCdtheta = dCtheta_gauss, theta.lower = -1,
theta.upper = 1, optim.method = "Brent", method = "mpl", s = 1,
m = 24, theta.start = 0.1, empirical = TRUE, r = 2, a = 0,
d.interval = c(-0.5, 0.5))
Arguments
xt |
a vector with the observed time series. Missing observations are allowed. |
copula |
an object of class ‘copula’. Readily available options
are |
dCdtheta |
a two parameter function that returns the limit of the copula
derivative, with respect to |
theta.lower |
the lower bound for |
theta.upper |
the upper bound for |
optim.method |
a character string specifying the optimization method.
For all available options see |
method |
a character string specifying the copula parameter estimator used. This can be one of: ‘mpl’, ‘itau’, ‘irho’, ‘itau.mpl’ or ‘ml’. See fitCopula for details. Default is ‘mpl’. |
s |
integer. The smallest lag |
m |
integer. The largest lag |
theta.start |
starting value for the parameter optimization via |
empirical |
logical. If |
r |
the exponent used in the Minkowski distance used to calculate |
a |
the value of |
d.interval |
a vector of size 2 giving the lower and upper bound for the
long memory parameter |
Value
\hat d
, the estimated value of d
.
Examples
#-------------------------
# ARFIMA(0,d,0) process
#-------------------------
trunc <- 50000
n = 1000
cks <- arfima.coefs(d = 0.25, trunc = trunc)
eps <- rnorm(trunc+n)
x <- sapply(1:n, function(t) sum(cks*rev(eps[t:(t+trunc)])))
#----------------------
# Original time series
#-----------------------
# For Frank copula, -Inf < theta < Inf. However, "Brent" requires
# finite lower and upper bounds so we use c(-100, 100) here
d_frank <- d.fit(xt = x, copula = frank, dCdtheta = dCtheta_frank,
theta.lower = -100, theta.upper = 100)
d_amh <- d.fit(xt = x, copula = amh, dCdtheta = dCtheta_amh,
theta.lower = -1, theta.upper = 1)
d_fgm <- d.fit(xt = x, copula = fgm, dCdtheta = dCtheta_fgm,
theta.lower = -1, theta.upper = 1)
d_gauss <- d.fit(xt = x, copula = gauss, dCdtheta = dCtheta_gauss,
theta.lower = -1, theta.upper = 1)
c(FRANK = d_frank, AMH = d_amh, FGM = d_fgm, GAUSS = d_gauss)
#----------------------------
# Adding some missing values
#----------------------------
index <- sample(1:n, size = round(0.2*n))
xt <- x
xt[index] <- NA
d_frank_m <- d.fit(xt = xt, copula = frank,
dCdtheta = dCtheta_frank,
theta.lower = -100, theta.upper = 100)
d_amh_m <- d.fit(xt = xt, copula = amh, dCdtheta = dCtheta_amh,
theta.lower = -1, theta.upper = 1)
d_fgm_m <- d.fit(xt = xt, copula = fgm, dCdtheta = dCtheta_fgm,
theta.lower = -1, theta.upper = 1)
d_gauss_m <- d.fit(xt = xt, copula = gauss,
dCdtheta = dCtheta_gauss,
theta.lower = -1, theta.upper = 1)
data.frame(
series = c("Complete", "Missing"),
FRANK = c(d_frank, d_frank_m),
AMH = c(d_amh, d_amh_m),
FGM = c(d_fgm, d_fgm_m),
GAUSS = c(d_gauss, d_gauss_m))
#-------------------------
# ARFIMA(1,d,1) process
#-------------------------
# For a faster algorithm to generate ARFIMA processes,
# see the package "arfima"
trunc <- 50000
cks <- arfima.coefs(d = 0.35, trunc = trunc, ar = -0.2, ma = 0.4)
n = 1000
eps <- rnorm(trunc+n)
x <- sapply(1:n, function(t) sum(cks*rev(eps[t:(t+trunc)])))
#----------------------
# Original time series
#-----------------------
# For Frank copula, -Inf < theta < Inf. However, "Brent" requires
# finite lower and upper bounds so we use c(-100, 100) here
d_frank <- d.fit(xt = x, copula = frank, dCdtheta = dCtheta_frank,
theta.lower = -100, theta.upper = 100)
d_amh <- d.fit(xt = x, copula = amh, dCdtheta = dCtheta_amh,
theta.lower = -1, theta.upper = 1)
d_fgm <- d.fit(xt = x, copula = fgm, dCdtheta = dCtheta_fgm,
theta.lower = -1, theta.upper = 1)
d_gauss <- d.fit(xt = x, copula = gauss, dCdtheta = dCtheta_gauss,
theta.lower = -1, theta.upper = 1)
c(FRANK = d_frank, AMH = d_amh, FGM = d_fgm, GAUSS = d_gauss)
#----------------------------
# Adding some missing values
#----------------------------
n = 1000
index <- sample(1:n, size = round(0.2*n))
xt <- x
xt[index] <- NA
d_frank_m <- d.fit(xt = xt, copula = frank,
dCdtheta = dCtheta_frank,
theta.lower = -100, theta.upper = 100)
d_amh_m <- d.fit(xt = xt, copula = amh, dCdtheta = dCtheta_amh,
theta.lower = -1, theta.upper = 1)
d_fgm_m <- d.fit(xt = xt, copula = fgm, dCdtheta = dCtheta_fgm,
theta.lower = -1, theta.upper = 1)
d_gauss_m <- d.fit(xt = xt, copula = gauss,
dCdtheta = dCtheta_gauss,
theta.lower = -1, theta.upper = 1)
data.frame(
series = c("Complete", "Missing"),
FRANK = c(d_frank, d_frank_m),
AMH = c(d_amh, d_amh_m),
FGM = c(d_fgm, d_fgm_m),
GAUSS = c(d_gauss, d_gauss_m))