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

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
3
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.

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.

Value

A data.frame with the following columns

n

The length of the sequence

rho

The value of rho that was used for generating the sequence

sigma_M

The value of sigma_M that was used for generating the sequence

sigma_R

The value of sigma_R that was used for generating the sequence

robust

0 if normally distributed innovations, 1 if t-distributed innovations

nu

If t-distributed innovations, the value of the degrees of freedom parameter

seed

The value used for seeding the random number generator

rw_rho

The value of rho estimated using the pure random walk model (always 0)

rw_sigma_M

The value of sigma_M estimated using the pure random walk model (always 0)

rw_sigma_R

The value of sigma_R estimated using the pure random walk model

rw_negloglik

The negative log likelihood of the fit obtained with the pure random walk model

mr_rho

The value of rho estimated using the pure mean-reversion model

mr_sigma_M

The value of sigma_M estimated using the pure mean-reversion model

mr_sigma_R

The value of sigma_R estimated using the pure mean-reversion model (always 0)

mr_negloglik

The negative log likelihood of the fit obtained with the pure mean-reversion model

par_rho

The value of rho estimated using the PAR model

par_sigma_M

The value of sigma_M estimated using the PAR model

par_sigma_R

The value of sigma_R estimated using the PAR model

par_negloglik

The negative log likelihood of the fit obtained with the PAR model

rw_lrt

The log likelihood ratio of the random walk model vs. the PAR model

mr_lrt

The log likelihood ratio of the mean-reversion model vs. the PAR model

kpss_stat

Statistic computed by the KPSS test (see ur.kpss)

kpss_p

p-value associated with kpss_stat

pvmr

Proportion of variance attributable to mean reversion found for PAR fit

Author(s)

Matthew Clegg matthewcleggphd@gmail.com

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

1
sample.likelihood_ratio.par(500, c(0.5,0.75), 1, c(1,2),nrep=3)

partialAR documentation built on April 14, 2020, 6:05 p.m.