Learn R Programming

DMQ (version 0.1.2)

UpdateDMQ: Update filtered quantiles

Description

Filter dynamic quantiles using an estimated model and an updated dataset.

Usage

UpdateDMQ(Fit, vY)

Value

An output like the one of EstimateDMQ with updated quantile estimated.

Arguments

Fit

The output of the function EstimateDMQ.

vY

numeric vector containing past and new observations.

Author

Leopoldo Catania

Details

The function can be used to compute a sequence of one-step-ahead rolling predictions, without updating the parameters of the model, see Examples.

Examples

Run this code
# Load Microsoft Corporation logarithmic percentage returns from December 8, 
# 2010 to November 15, 2018 for a total of T = 2000 observation
data("MSFT")

# Divide the sample in two equal parts
vY_is  = vY[1:1000]

##############################################################
######################## Estimate DMQ ########################
##############################################################

# Estimate DMQ over the deciles on the in sample period
Fit = EstimateDMQ(vY = vY_is,
                  vTau = seq(0.1, 0.9, 0.1),
                  iTau_star = 5,
                  FixReference = TRUE,
                  fn.optimizer = fn.solnp)

# compute a sequence of one-step-ahead rolling predictions over the out of sample

Roll = UpdateDMQ(Fit, vY) 

# one steap ahead predictions from time t = 1001 to 2001 are
mForecast = t(Roll$lFilter$mQ)[1001:2001, ]

Run the code above in your browser using DataLab