Financial Time Series Toolbox | ![]() ![]() |
Regress Return Series Against Metric Data
The explanatory (metric) data set is a weekly data set while the stock price data is a daily data set. The frequency needs to be the same. Use todaily
to convert the weekly series into a daily series. The constant needs to be included here to get the constant factor from the regression:
Get all the dates common to the return series calculated above and the explanatory (metric) data. Then combine the contents of the two series that have dates in both into a new time series:
Remove the contents of the new time series that are not finite:
Now, place the data to be regressed into a matrix using the function fts2mtx
. The first column of the matrix corresponds to the values of the first data series in the object, the second column to the second data series, and so on. In this case, the first column is regressed against the second and third column:
Using the regression coefficients, calculate the predicted return from the stock price data. Put the result into the return time series tret
as the data series PredReturn
:
![]() | Create Return Series | Plot the Results | ![]() |