I have developed a model to forecast the price development of Bitcoins. I have four lagged independent variables without a constant in a linear regression. However, the residuals are autorcorrelated. A test with BJAUTOFIT procedure leads to the conclusion that the best results were obtained with an ARIMA(0,1,5) model. I estimated the model over the full range of daily data from January 1, 2020 until the recent Friday, June 13, 2025. The fit is rather high and combining the forecasts of the linear model and for its residuals is very good.
My problem begun when I wanted to test how the fit of the model forecast for t+5 is, if the model starts using the data form the first available day until June 30, 2022 and re-estimate the parameters with ever new day until the end of the data sample. I used the following code.
Code: Select all
clear yhat5
do regend=2022:07:01, ende
comp number= regend-2022:07:01+1
linreg(noprint) BTC regstart regend btcresids
# Var1{5} Var2{5} Var3{5} Var4{5}
prj btc_est1 regstart+5 regend+5
disp number btc_est1(regend+5)
* BoxJenk(noprint,AR=0,Diff=1,MA=||1,2,5||,define=btc_forec1,Maxl) btcresids regstart+5 regend
* set resfit = %na
* set resfit = btcresids-%resids
* uforecast(equation=btc_forec1) resfit ende+1 ende+5
* set btc_for1 regstart+11 regend+5 = btc_est1+resfit
* set yhat5 regend regend = btc_For1(regend+5)
end do
Thank you very much for help in advance.
Best regards
PeterF