Search code examples
rforecastingestimationvolatility

Simulating returns from ARMA(1,1) - MCsGARCH(1,1) model


How can I find expected intraday return of ARMA(1,1) - MCsGARCH(1,1) Model in R?

The sample code of the model is available at http://www.unstarched.net/2013/03/20/high-frequency-garch-the-multiplicative-component-garch-mcsgarch-model/


Solution

  • I think you are mixing up something here. There is no "expected intraday return", for the ARMA(1,1) - MCsGARCH(1,1) there only is an estimation of the volatility of the following period/day (sigma, as you've already noticed in the comments).

    I assume you are referring to the last plot on the website you provided, that would mean you want to know the VaR (Value-at-Risk) that is calculated with the volatility from the estimation procedure.

    If you look at the code that was used to provide the plot:

    D = as.POSIXct(rownames(roll@forecast$VaR))
    VaRplot(0.01, actual = xts(roll@forecast$VaR[, 3], D), VaR = xts(roll@forecast$VaR[,1], D))
    

    You can see that the VaR (and the returns) where taken from the object roll. After you've run the simulation (without changing any variable names from the example), you could store them in a variable for later use like this:

    my_VaR = roll@forecast$VaR[, 1]
    my_act = roll@forecast$VaR[, 3]
    

    Where VaR, 1] is the first listelement for VaR. If you check str(roll) you see pretty much at the end, that:

    • Element 1: stands for the alpha(1%) VaR
    • Element 2: stands for the alpha(5%) VaR and
    • Element 3: stands for the realized return.

    To adress what you said in your comment:
    Have a look at the variable df (generated from as.data.frame(roll), that may include what you are looking for.


    I want to compare the expected return and the actual return.

    This seems to drift more in the direction of Cross Validated, but I'll try to give a brief outline.

    GARCH models are primarily used for volatility forecasting and to learn about the volatility dynamics of a time series (and/or the correlation dynamics in multivariate models). Now since variance is of the second moment, which translates to squared, it is always positive. But are returns always positive? Of course they are not. This means the volatility forecast gives us an idea of the magnitude of the returns of the next period, but at that point we don't know if it will be a positve return or a negative return. That's were the Value-at-Risk (VaR) comes into play.

    Take e. g. a portfolio manager who owns one asset. With a GARCH model he could predict the volatility of the next period (let's say he uses a daily return series, then that would be tomorrow). Traders watch the risk of their portfolio, it is much more closely monitored than the potential chances. So with the volatility forecast he can make a good guess about the risk he has of his asset loosing in value tomorrow. A 95%-VaR of lets say 1,000 EUR means, with a 95% probability, the risk (or loss) of tomorrow will not exceed 1,000 EUR. A higher probability comes with less certainty, so a 99%-VaR will be higher, e. g. 1,500 EUR.

    To wrap this up: there is no "expected" return, there is only a volatility forecast for tomorrow that gives an inclination (never certainty) of how tomorrows return could turn out. With the VaR this can be used for risk management. This is what is being done in the last part of the article you provided.


    what is the difference of ugarchsim and roll function?

    You could check in the documentation of the rugarch package, every function and its properties are explained in more detail in there. At a quick glance I would say ugarchsim is used if you want to fit a model to a complete time series. The last standard deviation is then the forecast for the next period. The documentation for ugarchroll says:

    ugarchroll-methods {rugarch} function: Univariate GARCH Rolling Density Forecast and Backtesting

    Description
    Method for creating rolling density forecast from ARMA-GARCH models with option for refitting every n periods with parallel functionality. is used aswell for forecasting as for backtesting.

    This is if you want to test how your model would've performed in the past. It only takes e. g. the first 300 datapoints provided and give the forecast for datapoint 301. Then the VaR (95% or 99%) is compared to the realized return of datapoint 301. Then the model is being refitted, giving a forecast for datapoint 302 and so on and on.


    Edit: added answers to the questions from the comments.