2
$\begingroup$

I am reading about HAR models for realised variance and they all seem to use WLS or OLS to calculate the parameters. Now I understand how that works if you just use say the 10 years of AAPL intraday history. However, if you're doing this for a univariate model on many stocks (like it seems the authors do to create stable parameter estimates) how is this done?

Do I just put say TSLA's stock at the bottom of the dataframe containing AAPL's and let it do the error minimisation and continue to just add n more stocks to this dataframe to get more and more robust estimates?

Edit re Pleb's request: https://www.sciencedirect.com/science/article/abs/pii/S0304407615002584 Page 7

We complement our analysis of the aggregate market with additional results for the 27 Dow Jones Constituents as of September 20, 2013 that traded continuously from the start to the end of our sample. Data on these individual stocks comes from the TAQ database. Our sample starts on April 21, 1997, one thousand trading days (the length of our estimation window) before the final decimalization of NASDAQ on April 9, 2001. The sample for the S&P 500 ends on August 30, 2013, while the sample for the individual stocks ends on December 31, 2013, yielding a total of 3096 observations for the S&P 500 and 3202 observations for the DJIA constituents. The first 1000 days are only used to estimate the models, so that the in-sample estimation results and the rolling out-of-sample forecasts are all based on the same samples.

To me this reads like they're bundling all of this data together into a 1,000 day training set and then doing the OLS on that. They don't give different model parameters for an S&P model and a DJIA Model, or one for each of the DJIA constituents they analysed.

$\endgroup$
5
  • $\begingroup$ I am unsure whether your question is theoretical or if you're asking about something that's purely programmatical? Could you please be more specific? $\endgroup$
    – Pleb
    Feb 11, 2023 at 19:03
  • $\begingroup$ Well I want to program it but I only want to program if it's the theoretically sound way... I am concerned that there will be some weird interplay between it being autoregressive and OLS when say 1 stock data ends and the new one begins if the values are vastly different. I.e. AAPL's values are in the single digits and TSLA are in double digits then will the cross over point cause any problems? $\endgroup$
    – BlueTurtle
    Feb 11, 2023 at 19:07
  • $\begingroup$ You model each stock independently? The HAR model is a univariate model with no intertemporal dependencies between stocks? Simply put, if there is some interplay between the stocks, the univariate HAR model will not capture it. Does this answer your question? $\endgroup$
    – Pleb
    Feb 11, 2023 at 19:25
  • $\begingroup$ No. The papers talk about how they have used the data of dozens of stocks over many years to do OLS and they propose to use those parameters for prediction of any stock going forward. They do not have different parameters for each stock. Meaning they must be either running the model once over a massive combined dataset of doing OLS once on ticker A, and then using those weights for the starting weights for ticker B and so on. $\endgroup$
    – BlueTurtle
    Feb 11, 2023 at 20:57
  • 1
    $\begingroup$ Give me a link to the paper you're referring to and also the section (page number) where they are detailing what you describe. Then I'll try to make some sense out of it :-) $\endgroup$
    – Pleb
    Feb 11, 2023 at 21:13

2 Answers 2

2
$\begingroup$

They regress univariately on each individual stock and index:

In order to conserve space and be within the scope of the main subject (there are also limitations set by the publisher), the authors only show the in-sample model estimation results for the S&P 500 (see Table 3). However, they do run the univariate (H)ARQ models on all individual constituents as-well as the Dow Jones index, but showing these results would be a "waste of space" since it has no direct value to the main research subject (ie. showing the forecast performance of the HARQ model).

If you take a look at the Web appendix and the published Matlab code there's direct evidence that they regress univariately on each individual stock:

  1. You can find the average in-sample parameter estimates across all individual stocks in Appendix C of the Web appendix. It also contains additional tables that is not in the original paper.

  2. Opening up BPQ2016_Replication_Stocks.m in the published Matlab code (see number 12) you will find the code snippet for the in-sample parameter estimates provided in Appendix C. In essence, they are simply looping over all stocks in their dataset and estimating the regression models using White's adjusted heteroscedastic consistent Least-squares Regression (hwhite function). If you have access to Matlab, I'll advice you to run the code yourself and play around with the results.

In conclusion, they run the univariate regression models across all constituents thus providing different parameter estimates for each individual stock. However, they are only providing averages of estimates, performance metrics and out-of-sample statistics throughout the main analysis and in the corresponding web-appendix. I hope this helps.

$\endgroup$
0
$\begingroup$

You seem to be interested in a multivariate regression (i.e. multiple equations, one for each stock) with a restriction that the parameter values are the same in each equation. If that is so, then stacking the data for each stock on top of each other to produce tall columns is a way to achieve that. You would have the target variable in the first column and the three regressors in the next three columns. Then just run OLS as we know it.

$\endgroup$
2
  • $\begingroup$ I will be interested in the Multi case as it's empirically shown to be better than the univariate model, but I just want to check my understand of how they've trained the univariate model is solid first. I will keep this in mind for the multi case though, thank you. $\endgroup$
    – BlueTurtle
    Feb 13, 2023 at 8:21
  • 1
    $\begingroup$ @BlueTurtle, if I got your description right, this is how they trained their univariate models. You cannot have a single univariate model for multiple dependent variables (multiple stocks), but you can restrict each model to have the same coefficients. This is what you suggest and what I find reasonable, as explained in my answer. $\endgroup$ Feb 13, 2023 at 9:16

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.