4
$\begingroup$

I used ugarchroll to backtest my garch model on S&P returns

this is my code

library(rugarch)
library(quantmod)
getSymbols("SPY")

rets = ROC(SPY$SPY.Close, na.pad = FALSE)

tgarch = ugarchspec(mean.model = list(armaOrder = c(1, 1)), 
                    variance.model = list(model = "sGARCH"),
                    distribution.model = "std")


garchroll <- ugarchroll(tgarch, data=rets, n.start=500, 
                        refit.window="window", refit.every=200)

however I am having trouble evaluating my model backtest . I tried to evaluate my model using MAPE - this was the code I used to get the MAPE OF my backtest

library(forecast)
preds<-as.data.frame(garchroll)

accuracy(preds$Mu, preds$Realized)

however When I tried to get my MAPE got

Inf

I also tried to use the report function to evaluate my model

report(garchroll)

however I do not know how to interpret the results of my model

VaR Backtest Report
===========================================
Model:              sGARCH-std
Backtest Length:    2719
Data:               

==========================================
alpha:              1%
Expected Exceed:    27.2
Actual VaR Exceed:  50
Actual %:           1.8%

Unconditional Coverage (Kupiec)
Null-Hypothesis:    Correct Exceedances
LR.uc Statistic:    15.491
LR.uc Critical:     3.841
LR.uc p-value:      0
Reject Null:        YES

Conditional Coverage (Christoffersen)
Null-Hypothesis:    Correct Exceedances and
                    Independence of Failures
LR.cc Statistic:    16.486
LR.cc Critical:     5.991
LR.cc p-value:      0
Reject Null:        YES

please help me interpret the results of my garch model your help will be greatly appreciated

$\endgroup$
1
  • $\begingroup$ Section 10.4 of the vignette of the rugarch package contains the information you need to interpret the diagnostic tests. $\endgroup$ Commented Mar 10, 2022 at 17:54

1 Answer 1

1
$\begingroup$

If your label data contains any zeroes, the MAPE of any prediction when the label is 0 is infinite...

$\endgroup$
2
  • 1
    $\begingroup$ Thank you for responding to my question .Is there a reason that there are zeroes in my data . Also How do I interpret the results of my model from the var backtest report $\endgroup$
    – Pelumi
    Commented Oct 22, 2019 at 15:15
  • $\begingroup$ There are many reasons why zeros can arise (and indeed why they cause division by zero issues, such as exploding MAPE that you see). While I cannot tell you exactly which reason you are facing as I don't see your data, here are some ideas/possibilities: 1. Zeros in data can arise from your original data provider (scrapers can return the value 0 when they don't find the data). 2. Zeros can also arise from poor NA-value handling (some csv readers will treat missing values or "nan" values as zero). $\endgroup$
    – Psi
    Commented Oct 22, 2019 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.