Learn R Programming

partialCI (version 1.2.0)

loglik.pci: Computes the log likelihood of a partially cointegrated model

Description

Computes the log likelihood of a partially cointegrated model

Usage

loglik.pci(Y, X, beta, rho, sigma_M, sigma_R, 
  M0 = 0, R0 = 0, 
  calc_method = c("css", "kfas", "ss", "sst", "csst"), 
  nu = pci.nu.default())

Arguments

Y

The time series that is to be modeled. A plain or zoo vector of length n.

X

A (possibly zoo) matrix of dimensions n x k. If k=1, then this may be a plain or zoo vector.

beta

A vector of length k representing the weightings to be given to the components of X.

rho

The coefficient of mean reversion.

sigma_M

The standard deviation of the innovations of the mean-reverting component of the model.

sigma_R

The standard deviation of the innovations of the random walk component of the model.

M0

The initial value of the mean-reverting component. Default = 0.

R0

The initial value of the random walk component. Default = 0.

calc_method

Specifies the Kalman filter implementation that will be used for computing the likelihood score:

  • "ss" Steady-state Kalman filter

  • "css" C++ implementation of steady-state Kalman filter

  • "kfas" Kalman filter implementation of the KFAS package

  • "sst" Steady-state Kalman filter using t-distributed innovations

  • "csst" C++ implementation of steady-state Kalman filter using t-distributed innovations

Default: css

nu

The degrees-of-freedom parameter to be used if calc_method is "sst" or "csst".

Value

The log of the likelihood score of the Kalman filter

Details

The partial cointegration model is given by the equations:

$$ Y_t = \beta_1 * X_{t,1} + beta_2 * X_{t,2} + ... + beta_k * X_{t,k} + M_t + R_t$$ $$M_t = \rho M_{t-1} + \epsilon_{M,t}$$ $$R_t = R_{t-1} + \epsilon_{R,t}$$ $$-1 < \rho < 1$$ $$\epsilon_{M,t} \sim N(0,\sigma_M^2)$$ $$\epsilon_{R,t} \sim N(0,\sigma_R^2)$$

Given the input series Y and X, and given the parameter values beta, rho, M0 and R0, the innovations epsilon_M[t] and epsilon_R[t] are calculated using a Kalman filter. Based upon these values, the log-likelihood score is then computed and returned.

References

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

See Also

egcm Engle-Granger cointegration model

partialAR Partially autoregressive models

Examples

Run this code
# NOT RUN {
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

    set.seed(1)
    YX <- rpci(n=500, beta=c(2,3,4), sigma_C=c(1,1,1), rho=0.9, sigma_M=0.1, sigma_R=0.2)
    loglik.pci(YX[,1], YX[,2:ncol(YX)], beta=c(2,3,4), rho=0.9, sigma_M=0.1, sigma_R=0.2)

# }

Run the code above in your browser using DataLab