Learn R Programming

partialCI (version 1.2.0)

rpci: Generates a random instance of a partial cointegration model

Description

Generates a random instance of a partial cointegration model

Usage

rpci(n, beta, sigma_C, rho, sigma_M, sigma_R, 
  include.state = FALSE, robust = FALSE, nu = 5)

Arguments

n

Number of observations to generate

beta

A vector of factor loadings

sigma_C

A vector of standard deviations

rho

The coefficient of mean reversion

sigma_R

The standard deviation of the innovations of the random walk portion of the residual series

sigma_M

The standard deviation of the innovations of the mean-reverting portion of the residual series

include.state

If TRUE, then the output data.frame contains the innovations to the factors and residual series, as well as the state of the residual series. Default: FALSE

robust

If TRUE, then a t-distribution is used to generate the innovations. Otherwise, the innovations are normally distributed. Default: FALSE.

nu

The degrees of freedom parameter used for t-distributed innovations. Default: 5.

Value

A data.frame of n rows representing the realization of the partially cointegrated sequence.

If include.state is FALSE, returns an n x (k+1) matrix whose columns are y, F_1, F_2, ..., F_k. If include.state is TRUE, returns an n x (2k + 6) matrix whose columns are y, F_1, F_2, ..., F_k, x, M, R, delta_1, delta_2, ..., delta_k, epsilon_M, epsilon_R.

Details

Generates a random set of partially cointegrated vectors. On input, n is the length of the sequence to be generated. beta is a vector of length k representing the coefficients of the factor loadings, and sigma_C is a vector of length k representing the standard deviations of the increments of the factor loadings.

Generates a random realization of the sequence $$Y_t = \beta_1 F_{1,t} + \beta_2 F_{2,t} + ... + \beta_k F_{k,t} + M_t + R_t$$ $$F_{i,j} = F_{i,j-1} + \delta_{i,j}$$ $$M_t = \rho m_{t-1} + \epsilon_{M,t}$$ $$R_t = r_{t-1} + \epsilon_{R,t}$$ $$\delta_{i,j} ~ N(0, \sigma_{C,i}^2)$$ $$\epsilon_{M,t} ~ N(0, \sigma_M^2)$$ $$\epsilon_{R,t} ~ N(0, \sigma_R^2)$$

See Also

fit.pci

Examples

Run this code
# NOT RUN {
rpci(10, beta=1, sigma_C=1, rho=0.9, sigma_R=1, sigma_M=1)
# }

Run the code above in your browser using DataLab