Marco Dainelli
Marco Dainelli

Reputation: 23

R-Backtesting of a Model

I have to evaluate the forecasting power of my model.

On my database I have 5 years of hourly data of 150 variables .

What I want to do?

1) OLS regression using the data of the first 4 years and then save variable's coefficient.

Result of my regression:

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 271.6 on 34565 degrees of freedom Multiple R-squared: 0.9552, Adjusted R-squared: 0.9545 F-statistic: 1479 on 498 and 34565 DF, p-value: < 2.2e-16

2) Use the saved coefficients combined with the data of the last years to forecast my Y and then compare the forecasted Y to the actual Y.

I know how to do 1) but i don't know how to do 2).

Any suggestion?

Best Regards.

Upvotes: 2

Views: 569

Answers (1)

ashwin agrawal
ashwin agrawal

Reputation: 1611

May I know which R package you are using to build the OLS regression model, generally to predict the predict function is used to predict the values based on certain parameters. Below is the link for predict function documentation. https://www.rdocumentation.org/packages/car/versions/3.0-3/topics/Predict

Upvotes: 0

Related Questions