| estimate_ar_res | R Documentation |
Fits an autoregressive model of order p for the horizon-h
target and returns the OLS coefficients and residuals.
estimate_ar_res(y, h, p)
y |
Numeric vector of the target variable. |
h |
Positive integer; forecast horizon. |
p |
Non-negative integer; AR lag order. |
A list with components:
Coefficient vector (intercept first).
Residual vector.
y <- arima.sim(list(ar = 0.7), n = 200)
ar_fit <- estimate_ar_res(y, h = 1, p = 1)
ar_fit$a_hat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.