Description Usage Arguments Details Value Author(s) References See Also Examples
Generates random samples of the likelihood ratio for the partially autoregressive model
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)
|
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 |
robust |
If |
nu |
If |
seed.start |
Starting seed to use for the random number generator. |
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.
A data.frame
with the following columns
n |
The length of the sequence |
rho |
The value of |
sigma_M |
The value of |
sigma_R |
The value of |
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 |
rw_sigma_M |
The value of |
rw_sigma_R |
The value of |
rw_negloglik |
The negative log likelihood of the fit obtained with the pure random walk model |
mr_rho |
The value of |
mr_sigma_M |
The value of |
mr_sigma_R |
The value of |
mr_negloglik |
The negative log likelihood of the fit obtained with the pure mean-reversion model |
par_rho |
The value of |
par_sigma_M |
The value of |
par_sigma_R |
The value of |
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 |
kpss_p |
p-value associated with |
pvmr |
Proportion of variance attributable to mean reversion found for PAR fit |
Matthew Clegg matthewcleggphd@gmail.com
Clegg, Matthew. Modeling Time Series with Both Permanent and Transient Components using the Partially Autoregressive Model. Available at SSRN: http://ssrn.com/abstract=2556957
1 | sample.likelihood_ratio.par(500, c(0.5,0.75), 1, c(1,2),nrep=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.