LS.whittle {LSTS} | R Documentation |
Whittle estimator to Locally Stationary Time Series
Description
This function computes Whittle estimator to LS-ARMA and LS-ARFIMA models.
Usage
LS.whittle(
series,
start,
order = c(p = 0, q = 0),
ar.order = NULL,
ma.order = NULL,
sd.order = NULL,
d.order = NULL,
include.d = FALSE,
N = NULL,
S = NULL,
include.taper = TRUE,
control = list(),
lower = -Inf,
upper = Inf,
m = NULL,
n.ahead = 0
)
Arguments
series |
(type: numeric) univariate time series. |
start |
(type: numeric) numeric vector, initial values for parameters to run the model. |
order |
(type: numeric) vector corresponding to |
ar.order |
(type: numeric) AR polimonial order. |
ma.order |
(type: numeric) MA polimonial order. |
sd.order |
(type: numeric) polinomial order noise scale factor. |
d.order |
(type: numeric) |
include.d |
(type: numeric) logical argument for |
N |
(type: numeric) value corresponding to the length of the window to
compute periodogram. If |
S |
(type: numeric) value corresponding to the lag with which will go taking the blocks or windows. |
include.taper |
(type: logical) logical argument that by default is
|
control |
(type: list) A list of control parameters. More details in
|
lower |
(type: numeric) lower bound, replicated to be as long as
|
upper |
(type: numeric) upper bound, replicated to be as long as
|
m |
(type: numeric) truncation order of the MA infinity process, by
default |
n.ahead |
(type: numeric) The number of steps ahead for which prediction is required. By default is zero. |
Details
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.
Value
A list with the following components:
coef |
The best set of parameters found. |
var.coef |
covariance matrix approximated for maximum likelihood
estimator |
loglik |
log-likelihood of |
aic |
Akaike'S ‘An Information Criterion’, for one fitted model LS-ARMA
or LS-ARFIMA. The formula is |
series |
original time serie. |
residuals |
standard residuals. |
fitted.values |
model fitted values. |
pred |
predictions of the model. |
se |
the estimated standard errors. |
model |
A list representing the fitted model. |
See Also
Examples
# 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
)