Applies a fitted AR model to a new dataset.
# S3 method for AR refit(object, new_data, specials = NULL, reestimate = FALSE, ...)
object | The time series model used to produce the forecasts |
---|---|
new_data | A |
specials | (passed by |
reestimate | If |
... | Additional arguments for forecast model methods. |
A refitted model.
lung_deaths_male <- as_tsibble(mdeaths) lung_deaths_female <- as_tsibble(fdeaths) fit <- lung_deaths_male %>% model(AR(value ~ 1 + order(10))) report(fit)#> Series: value #> Model: AR(10) w/ mean #> #> Coefficients: #> constant ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 #> 572.0428 0.6739 -0.1584 0.1291 -0.1581 -0.0342 0.012 -0.1172 -0.0832 #> ar9 ar10 #> -0.0712 0.4145 #> #> sigma^2 estimated as 37672 #> AIC = -93.6 AICc = -89.2 BIC = -68.55fit %>% refit(lung_deaths_female) %>% report()#> Series: value #> Model: AR(10) w/ mean #> #> Coefficients: #> constant ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 #> 102807.6 0.6739 -0.1584 0.1291 -0.1581 -0.0342 0.012 -0.1172 -0.0832 #> ar9 ar10 #> -0.0712 0.4145 #> #> sigma^2 estimated as 1.053e+10 #> AIC = 913.99 AICc = 913.99 BIC = 913.99