fits: Fits the best model from classes ARIMA, ETS, TBATS and...

Description Usage Arguments Value References Examples

View source: R/fits.R

Description

Fits the best model from classes ARIMA, ETS, TBATS and NNETAR.

Usage

1
2
3
fits(x, train = 0.8, steps = NULL, max.points = 500,
  show.main.graph = T, show.sec.graph = F, show.value = T, PI = F,
  theme.doj = F)

Arguments

x

A vector or ts object.

train

The (initial) percentage of the time series to be used to train the models. Must be 0 < train < 1.

steps

Number of steps to forecast. If NULL, uses the number of points not used in training (testing points). Can't be less than the number of testing points.

max.points

Limits the maximum number of points to be used in modeling. Uses the first max.points points of the series.

show.main.graph

Logical. Should the main graphic (with the final model) be displayed?

show.sec.graph

Logical. Should the secondary graphics (with the training models) be displayed?

show.value

Logical. Should the values be displayed?

PI

Prediction Interval used in nnar models. May take long time processing.

theme.doj

Logical. Should the theme of Decades Of Jurimetrics be used?

Value

$fcast Predicted time series using the model that minimizes the forecasting mean square error.

$mse.pred Mean squared error of prediction. Used to decide the best model.

$runtime Running time.

References

Hyndman, R.J., & Athanasopoulos, G. (2018) Forecasting: principles and practice, 2nd edition, OTexts: Melbourne, Australia. otexts.com/fpp2.

https://robjhyndman.com/hyndsight/nnetar-prediction-intervals/

https://robjhyndman.com/talks/Google-Oct2015-part1.pdf

Zabala, F. J. and Silveira, F. F. (2019). Decades of Jurimetrics.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(jurimetrics)

fits(livestock)
fits(livestock, theme.doj = T)
fits(livestock, show.main.graph = F, show.sec.graph = T, show.value = F)

fits(h02, .9)

fits(gas)

data('tjmg_year')
y1 <- ts(tjmg_year$count, start = c(2000,1), frequency = 1)
fits(y1)

data(tjrs_year_month)
y2 <- ts(tjrs_year_month$count, start = c(2000,1), frequency = 12)
fits(y2, train = 0.8, steps = 24)

IsmaelRohrig/Jurimetria documentation built on Nov. 23, 2019, 12:02 a.m.