LS.whittle: Whittle estimator to Locally Stationary Time Series

Description Usage Arguments Details Value See Also Examples

View source: R/ls_whittle.R

Description

This function computes Whittle estimator to LS-ARMA and LS-ARFIMA models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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 ARMA model entered.

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) d polinomial order, where d is the ARFIMA parameter.

include.d

(type: numeric) logical argument for ARFIMA models. If include.d=FALSE then the model is an ARMA process.

N

(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.

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 TRUE. See periodogram.

control

(type: list) A list of control parameters. More details in nlminb .

lower

(type: numeric) lower bound, replicated to be as long as start. If unspecified, all parameters are assumed to be lower unconstrained.

upper

(type: numeric) upper bound, replicated to be as long as start. If unspecified, all parameters are assumed to be upper unconstrained.

m

(type: numeric) truncation order of the MA infinity process, by default m = 0.25n^{0.8}. Parameter used in LSTS_kalman.

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

Φ(t/T, \, B)\, Y_{t, T} = Θ(t/T,\, B)\,σ(t/T)\, \varepsilon_t

and LS-ARFIMA

Φ(t/T, \, B)\, Y_{t, T} = Θ(t/T,\, B)\, (1-B)^{-d(t/T)}\, σ(t/T)\, \varepsilon_t,

with infinite moving average expansion

Y_{t, T} = σ(t/T)\, ∑_{j=0}^{∞} ψ(t/T)\,\varepsilon_t,

for t = 1,…, T, where for u = t/T \in [0,1], Φ(u,B)=1+φ_1(u)B +\cdots+φ_p(u)B^p is an autoregressive polynomial, Θ(u, B) = 1 + θ_1(u)B + \cdots + θ_q(u)B^q is a moving average polynomial, d(u) is a long-memory parameter, σ(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 Φ(u, B), Θ(u, B), d(u) and σ(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, …, be a basis for a space of smoothly varying functions and let d_{θ}(u) be the time-varying long-memory parameter in model LS-ARFIMA. Then we could write d_{θ}(u) in terms of the basis \{g_j(u) = u^j\} as follows d_{θ}(u) = ∑_{j=0}^{k} α_j\,g_j(u) for unknown values of k and θ = (α_0,\,α_1,\,…, \,α_k)^{\prime}. In this situation, estimating θ involves determining k and estimating the coefficients α_0,\,α_1,\,…, \,α_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 \hat{θ} of θ:=(θ_1,…,θ_k)^{\prime}. This matrix is approximated by H^{-1}/n, where H is the Hessian matrix [\partial^2 \ell(θ)/\partialθ_i \partialθ_j]_{i,j=1}^{k}.

loglik

log-likelihood of coef, calculated with LS.whittle.

aic

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.

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

nlminb, LS.kalman

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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
)

LSTS documentation built on July 29, 2021, 5:07 p.m.

Related to LS.whittle in LSTS...