partialAR (version 1.0.3)

loglik.par: Negative log likelihood of a partially autoregressive fit

Description

Negative log likelihood of a partially autoregressive fit

Usage

loglik.par(Y, rho, sigma_M, sigma_R, M0 = 0, R0 = Y[1], 
  calc_method = c("css", "fkf", "ss", "sst", "csst"), 
  nu = par.nu.default())

Arguments

Y
A numeric vector representing the time series to which the partially autoregressive model is being fit.
rho
The coefficient of mean reversion
sigma_M
Standard deviation of the innovations of the mean-reverting process
sigma_R
Standard deviation of the innovations of the random walk process
M0
Initial value of the mean-reverting process
R0
Initial value of the random walk process
calc_method
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++
nu
If calc_method is "sst" or "csst", this specifies the number of degrees of freedom of the t-distribution.

Value

  • Returns the negative log likelihood of fitting the partially autoregressive model with parameters (rho, sigma_M, sigma_R, M0, R0) to the data series Y.

References

Clegg, Matthew. Modeling Time Series with Both Permanent and Transient Components using the Partially Autoregressive Model. Available at SSRN: http://ssrn.com/abstract=2556957

See Also

fit.par

Examples

Run this code
loglik.par(0,0,0,1)  # -> same as -log(dnorm(0))
loglik.par(0,0,1,0)  # -> same as -log(dnorm(0))
loglik.par(0,0,1,1)  # -> same as -log(dnorm(0,0,sqrt(2)))

Run the code above in your browser using DataLab