This function computes Whittle estimator to LS-ARMA and LS-ARFIMA models.
(type: numeric) univariate time series.
(type: numeric) numeric vector, initial values for parameters to run the model.
(type: numeric) vector corresponding to ARMA
model
entered.
(type: numeric) AR polimonial order.
(type: numeric) MA polimonial order.
(type: numeric) polinomial order noise scale factor.
(type: numeric) d
polinomial order, where d
is
the ARFIMA
parameter.
(type: numeric) logical argument for ARFIMA
models.
If include.d=FALSE
then the model is an ARMA process.
(type: numeric) value corresponding to the length of the window to
compute periodogram. If N=NULL
then the function will use
\(N = \textrm{trunc}(n^{0.8})\), see Dahlhaus (1998) where \(n\) is the
length of the y
vector.
(type: numeric) value corresponding to the lag with which will go taking the blocks or windows.
(type: logical) logical argument that by default is
TRUE
. See periodogram
.
(type: list) A list of control parameters. More details in
nlminb
.
(type: numeric) lower bound, replicated to be as long as
start
. If unspecified, all parameters are assumed to be lower
unconstrained.
(type: numeric) upper bound, replicated to be as long as
start
. If unspecified, all parameters are assumed to be upper
unconstrained.
(type: numeric) truncation order of the MA infinity process, by
default \(m = 0.25n^{0.8}\). Parameter used in LSTS_kalman
.
(type: numeric) The number of steps ahead for which prediction is required. By default is zero.
A list with the following components:
The best set of parameters found.
covariance matrix approximated for maximum likelihood estimator \(\hat{\theta}\) of \(\theta:=(\theta_1,\ldots,\theta_k)^{\prime}\). This matrix is approximated by \(H^{-1}/n\), where \(H\) is the Hessian matrix \([\partial^2 \ell(\theta)/\partial\theta_i \partial\theta_j]_{i,j=1}^{k}\).
log-likelihood of coef
, calculated with
LS.whittle
.
Akaike'S `An Information Criterion', for one fitted model LS-ARMA
or LS-ARFIMA. The formula is \(-2L + 2k/n\), where L represents the
log-likelihood, k represents the number of parameters in the fitted
model and n is equal to the length of the series
.
original time serie.
standard residuals.
model fitted values.
predictions of the model.
the estimated standard errors.
A list representing the fitted model.
This function estimates the parameters in models: LS-ARMA
$$\Phi(t/T, \, B)\, Y_{t, T} = \Theta(t/T,\, B)\,\sigma(t/T)\,
\varepsilon_t$$ and LS-ARFIMA $$\Phi(t/T, \, B)\, Y_{t, T} =
\Theta(t/T,\, B)\, (1-B)^{-d(t/T)}\, \sigma(t/T)\, \varepsilon_t,$$
with infinite moving average expansion
$$Y_{t, T} = \sigma(t/T)\, \sum_{j=0}^{\infty}
\psi(t/T)\,\varepsilon_t,$$ for \(t = 1,\ldots, T\), where for
\(u = t/T \in [0,1]\), \(\Phi(u,B)=1+\phi_1(u)B +\cdots+\phi_p(u)B^p\)
is an autoregressive polynomial,
\(\Theta(u, B) = 1 + \theta_1(u)B + \cdots + \theta_q(u)B^q\) is a
moving average polynomial, \(d(u)\) is a long-memory parameter,
\(\sigma(u)\) is a noise scale factor and \(\{\varepsilon_t \}\) is a
Gaussian white noise sequence with zero mean and unit variance. This class
of models extends the well-known ARMA and ARFIMA process, which is obtained
when the components \(\Phi(u, B)\), \(\Theta(u, B)\), \(d(u)\) and
\(\sigma(u)\) do not depend on \(u\).
The evolution of these models can be specified in terms of a general class
of functions. For example, let \(\{g_j(u)\}\), \(j = 1, 2, \ldots\), be
a basis for a space of smoothly varying functions and let
\(d_{\theta}(u)\) be the time-varying long-memory parameter in model
LS-ARFIMA. Then we could write \(d_{\theta}(u)\) in terms of the basis
\(\{g_j(u) = u^j\}\) as follows
\(d_{\theta}(u) = \sum_{j=0}^{k} \alpha_j\,g_j(u)\)
for unknown values of \(k\) and
\(\theta = (\alpha_0,\,\alpha_1,\,\ldots, \,\alpha_k)^{\prime}\).
In this situation, estimating \(\theta\) involves determining \(k\) and
estimating the coefficients \(\alpha_0,\,\alpha_1,\,\ldots, \,\alpha_k\).
LS.whittle
optimizes LS.whittle.loglik
as objective
function using nlminb
function, for both LS-ARMA
(include.d=FALSE
) and LS-ARFIMA (include.d=TRUE
) models.
Also computes Kalman filter with LS.kalman
and this values
are given in var.coef
in the output.
# Analysis by blocks of phi and sigma parameters
N <- 200
S <- 100
M <- trunc((length(malleco) - N) / S + 1)
table <- c()
for (j in 1:M) {
x <- malleco[(1 + S * (j - 1)):(N + S * (j - 1))]
table <- rbind(table, nlminb(
start = c(0.65, 0.15), N = N,
objective = LS.whittle.loglik,
series = x, order = c(p = 1, q = 0)
)$par)
}
u <- (N / 2 + S * (1:M - 1)) / length(malleco)
table <- as.data.frame(cbind(u, table))
colnames(table) <- c("u", "phi", "sigma")
# Start parameters
phi <- smooth.spline(table$phi, spar = 1, tol = 0.01)$y
fit.1 <- nls(phi ~ a0 + a1 * u, start = list(a0 = 0.65, a1 = 0.00))
sigma <- smooth.spline(table$sigma, spar = 1)$y
fit.2 <- nls(sigma ~ b0 + b1 * u, start = list(b0 = 0.65, b1 = 0.00))
fit_whittle <- LS.whittle(
series = malleco, start = c(coef(fit.1), coef(fit.2)), order = c(p = 1, q = 0),
ar.order = 1, sd.order = 1, N = 180, n.ahead = 10
)