Computes the log likelihood ratio for the partially autoregressive model.
First, a fit is performed for the specified null model. Then, a fit is performed for the alternative model that the sequence is partially autoregressive. The likelihood scores are computed for both models, and the log likelihood ratio is returned.
likelihood_ratio.par(X, robust = FALSE, null_model = c("rw", "ar1"),
opt_method = c("css", "kfas", "ss"), nu = par.nu.default())
The numeric vector or zoo vector to which the partially autoregressive model is being fit.
If TRUE
, then errors are assumed to follow a t-distribution
with nu
degrees of freedom. If FALSE
, then errors are assumed
to follow a normal distribution. Default: FALSE
Specifies the null hypothesis:
"ar1" Pure autoregressive (e.g., sigma_R = 0
)
Default: "rw"
The method to be used for calculating the negative log likelihood.
"ss"
Steady-state Kalman filter with normally distributed errors
"css"
Steady-state Kalman filter with normally distributed errors,
coded in C++
"kfas"
Traditional Kalman filter of the KFAS
package
Default: "css"
If robust
is TRUE
, this specifies
the number of degrees of freedom of the t-distribution. Default: 5
A numeric value representing the log likelihood ratio
Clegg, Matthew. Modeling Time Series with Both Permanent and Transient Components using the Partially Autoregressive Model. Available at SSRN: http://ssrn.com/abstract=2556957