partialAR (version 1.0.3)

sample.likelihood_ratio.par: Generates random samples of the likelihood ratio for the partially autoregressive model

Description

Generates random samples of the likelihood ratio for the partially autoregressive model

Usage

sample.likelihood_ratio.par(n = 500, rho = 0.8, sigma_M = 1, sigma_R = 1, 
  nrep = 1000, use.multicore = TRUE, robust = FALSE, 
  nu = par.nu.default(), seed.start = 0)

Arguments

n
Length of the randomly generated sequence. Possibly a vector.
rho
The coefficient of mean reversion. Possibly a vector.
sigma_M
Standard deviation of the innovations of the mean-reverting process. Possibly a vector.
sigma_R
Standard deviation of the innovations of the random walk process. Possibly a vector.
nrep
Number of repetitions to perform
use.multicore
If TRUE, then the parallel package is used to speed up processing.
robust
If TRUE, then sequences containing t-distributed errors are generated, and robust fits are performed. Possibly a vector.
nu
If robust is TRUE, then this is the degrees-of-freedom parameter to be used. Possibly a vector.
seed.start
Starting seed to use for the random number generator.

Value

  • A data.frame with the following columns
  • nThe length of the sequence
  • rhoThe value of rho that was used for generating the sequence
  • sigma_MThe value of sigma_M that was used for generating the sequence
  • sigma_RThe value of sigma_R that was used for generating the sequence
  • robust0 if normally distributed innovations, 1 if t-distributed innovations
  • nuIf t-distributed innovations, the value of the degrees of freedom parameter
  • seedThe value used for seeding the random number generator
  • rw_rhoThe value of rho estimated using the pure random walk model (always 0)
  • rw_sigma_MThe value of sigma_M estimated using the pure random walk model (always 0)
  • rw_sigma_RThe value of sigma_R estimated using the pure random walk model
  • rw_negloglikThe negative log likelihood of the fit obtained with the pure random walk model
  • mr_rhoThe value of rho estimated using the pure mean-reversion model
  • mr_sigma_MThe value of sigma_M estimated using the pure mean-reversion model
  • mr_sigma_RThe value of sigma_R estimated using the pure mean-reversion model (always 0)
  • mr_negloglikThe negative log likelihood of the fit obtained with the pure mean-reversion model
  • par_rhoThe value of rho estimated using the PAR model
  • par_sigma_MThe value of sigma_M estimated using the PAR model
  • par_sigma_RThe value of sigma_R estimated using the PAR model
  • par_negloglikThe negative log likelihood of the fit obtained with the PAR model
  • rw_lrtThe log likelihood ratio of the random walk model vs. the PAR model
  • mr_lrtThe log likelihood ratio of the mean-reversion model vs. the PAR model
  • kpss_statStatistic computed by the KPSS test (see ur.kpss)
  • kpss_pp-value associated with kpss_stat
  • pvmrProportion of variance attributable to mean reversion found for PAR fit

Details

The purpose of this function is to facilitate studying the behavior of the fit.par function by generating random partially autoregressive sequences and determining the maximum likelihood fits to them. For each combination of parameter values given by n, rho, sigma_M, sigma_R, robust and nu, generates nrep random partially autoregressive sequences with these parameters. Then, uses fit.par to fit the sequence using the partially autoregressive model, the pure random walk model and the pure mean reversion model. Returns a data.frame containing the results of the fits.

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
sample.likelihood_ratio.par(500, c(0.5,0.75), 1, c(1,2),nrep=3)

Run the code above in your browser using DataCamp Workspace