I wonder if I first filter out AR(1) (autoregressive model with lag 1) effects from univariate time series and then fit stochastic volatility model does above procedure introduce any bias at first or second step (first step - fitting AR(1), second step - fitting SV model) ? I'm especially interested in potential bias in fitting AR(1) model. This question have came to my mind after using 'stochvol' R package, where I can't add autoregressive part to stochastic volatility model.


Even though it's a straightforward extension, it took me a while (a year? yikes!); but now you can easily incorporate Bayesian ar(1) (or more generally, Bayesian regression) in joint estimation by using designmatrix = "ar(1)" as an argument to svsample. It's not well documented yet (except in the help files), but I nevertheless hope easy to use.

From the help file of svsample:

## Another example, this time with an AR(1) structure for the mean
## Not run: 
y <- exrates$USD

## Fit AR(1)-SV model to EUR-USD exchange rates
res <- svsample(y, designmatrix = "ar1")

## Use predict.svdraws to obtain predictive volatilities
ahead <- 100
predvol <- predict(res, steps = ahead)

## Use arpredict to obtain draws from the posterior predictive
preddraws <- arpredict(res, predvol)

## Calculate predictive quantiles
predquants <- apply(preddraws, 2, quantile, c(.1, .5, .9))

## Visualize
ts.plot(y, xlim = c(length(y) - ahead, length(y) + ahead),
    ylim = range(predquants))
for (i in 1:3) {
 lines((length(y) + 1):(length(y) + ahead), predquants[i,],
       col = 3, lty = i 

## End(Not run)

Please let me know if you find any glitches!

  • $\begingroup$ Hi Gregor Kastner, welcome to Quant.SE! Thank you for your contribution :) $\endgroup$
    – Bob Jansen
    Oct 14 '15 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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