
Last chance! 50% off unlimited learning
Sale ends in
Method returning the predictive density (pdf).
PredPdf(object, ...)# S3 method for MSGARCH_SPEC
PredPdf(
object,
x = NULL,
par = NULL,
data = NULL,
log = FALSE,
do.its = FALSE,
nahead = 1L,
do.cumulative = FALSE,
ctr = list(),
...
)
# S3 method for MSGARCH_ML_FIT
PredPdf(
object,
x = NULL,
newdata = NULL,
log = FALSE,
do.its = FALSE,
nahead = 1L,
do.cumulative = FALSE,
ctr = list(),
...
)
# S3 method for MSGARCH_MCMC_FIT
PredPdf(
object,
x = NULL,
newdata = NULL,
log = FALSE,
do.its = FALSE,
nahead = 1L,
do.cumulative = FALSE,
ctr = list(),
...
)
A vector or matrix of class MSGARCH_PRED
.
If do.its = FALSE
: (Log-)predictive of
the points x
at t = T + T* + 1, ... ,t = T + T* + nahead
(matrix of
size nahead
x n).
If do.its = TRUE
: In-sample predictive of data
if x = NULL
(vector of size T + T*) or in-sample predictive of x
(matrix of size (T + T*) x n).
Model specification of class MSGARCH_SPEC
created with CreateSpec
or fit object of type MSGARCH_ML_FIT
created with FitML
or MSGARCH_MCMC_FIT
created with FitMCMC
.
Not used. Other arguments to PredPdf
.
Vector (of size n). Used when do.its = FALSE
.
Vector (of size d) or matrix (of size nmcmc
x d) of parameter
estimates where d must have the same length as the default parameters of the specification.
Vector (of size T) of observations.
Logical indicating if the log-density is returned. (Default: log = FALSE
)
Logical indicating if the in-sample predictive is returned. (Default: do.its = FALSE
)
Scalar indicating the number of step-ahead evaluation.
Valid only when do.its = FALSE
. (Default: nahead = 1L
)
Logical indicating if predictive density is computed on the
cumulative simulations (typically log-returns, as they can be aggregated).
Only available for do.its = FALSE
. (Default: do.cumulative = FALSE
)
A list of control parameters:
nsim
(integer >= 0) :
Number indicating the number of simulation done for the evaluation
of the density at nahead
> 1. (Default: nsim = 10000L
)
Vector (of size T*) of new observations. (Default newdata = NULL
)
If a matrix of MCMC posterior draws is given, the Bayesian
predictive probability density is calculated.
Two or more step-ahead predictive probability density are estimated via simulation of nsim
paths up to
t = T + T* + nahead
. The predictive distribution are then inferred from these
simulations via a Gaussian Kernel density.
If do.its = FALSE
, the vector x
are evaluated as t = T + T* + 1, ... ,t = T + T* + nahead
realization.
If do.its = TRUE
and x
is evaluated
at each time t
up top time t = T + T*
.
Finally, if x = NULL
the vector data
is evaluated for sample
evaluation of the predictive denisty ((log-)likelihood of each sample points).
# create model specification
spec <- CreateSpec()
# load data
data("SMI", package = "MSGARCH")
# fit the model on the data by ML
fit <- FitML(spec = spec, data = SMI)
# run PredPdf method in-sample
pred.its <- PredPdf(object = fit, log = TRUE, do.its = TRUE)
# create a mesh
x <- seq(-3,3,0.01)
# run PredPdf method on mesh at T + 1
pred.x <- PredPdf(object = fit, x = x, log = TRUE, do.its = FALSE)
Run the code above in your browser using DataLab