jubilee.ols {jubilee}R Documentation

Internal utility to calculate OLS regression

Description

Calculate the OLS regression for a given time series and fraction

Usage

jubilee.ols(fraction, ts, lookback.channel, tol.frac = 1/6)

Arguments

fraction

numeric, the ending fraction of regression

ts

numeric, the time series data

lookback.channel

numeric, the backward-looking regression period

tol.frac

numeric, tolerance of missing data in the beginning, expressed as fraction. Default is 1/6, that is, two months.

Value

data.table with columns of fraction, lm.a, lm.y, lm.r

Author(s)

Stephen H. Lihn

References

See Section 2.3 of Stephen H.T. Lihn, "Jubilee Tectonic Model: Forecasting Long-Term Growth and Mean Reversion in the U.S. Stock Market." Available at http://dx.doi.org/10.2139/ssrn.3156574

Examples

## Not run: 
  dtb <- jubilee.repo(online=FALSE)@ie
  df <- jubilee.ols(dtb$fraction, dtb$log.tri, 50)
  subset(df, fraction > 1970 & fraction < 1970.05)
  # fraction     lm.a      lm.r       lm.y
  # 1970.042 11.86401 0.1007617 0.02103105

## End(Not run)

[Package jubilee version 0.3.3 Index]