naive is the model constructor for a random walk model applied to y
.
This is equivalent to an ARIMA(0,1,0) model. naive()
is simply a wrapper
to maintain forecast package similitude. seasonal
returns the model constructor
for a seasonal random walk equivalent to an ARIMA(0,0,0)(0,1,0)m model where m is the
seasonal period.
stan_naive(
ts,
seasonal = FALSE,
m = 0,
chains = 4,
iter = 2000,
warmup = floor(iter/2),
adapt.delta = 0.9,
tree.depth = 10,
stepwise = TRUE,
prior_mu0 = NULL,
prior_sigma0 = NULL,
series.name = NULL,
...
)
a numeric or ts object with the univariate time series.
a Boolean value for select a seasonal random walk instead.
an optional integer value for the seasonal period.
An integer of the number of Markov Chains chains to be run, by default 4 chains are run.
An integer of total iterations per chain including the warm-up, by default the number of iterations are 2000.
A positive integer specifying number of warm-up (aka burn-in)
iterations. This also specifies the number of iterations used for step-size
adaptation, so warm-up samples should not be used for inference. The number
of warmup should not be larger than iter
and the default is
iter/2
.
An optional real value between 0 and 1, the thin of the jumps in a HMC method. By default is 0.9.
An integer of the maximum depth of the trees evaluated during each iteration. By default is 10.
If TRUE, will do stepwise selection (faster). Otherwise, it searches over all models. Non-stepwise selection can be very slow, especially for seasonal models.
The prior distribution for the location parameter in an ARIMA model. By default
the value is set NULL
, then the default student(7,0,1) prior is used.
The prior distribution for the scale parameter in an ARIMA model. By default
the value is set NULL
, then the default student(7,0,1) prior is used.
an optional string vector with the series names.
Further arguments passed to varstan
function.
A varstan
object with the fitted naive Random Walk model.
The random walk with drift model is $$Y_t = mu_0 + Y_{t-1} + epsilon_t$$ where \(epsilon_t\) is a normal iid error.
The seasonal naive model is $$Y_t = mu_0 + Y_{t-m} + epsilon_t$$ where \(epsilon_t\) is a normal iid error.
Hyndman, R. & Khandakar, Y. (2008). Automatic time series forecasting: the
forecast package for R
. Journal of Statistical Software. 26(3),
1-22.doi: 10.18637/jss.v027.i03
.
Box, G. E. P. and Jenkins, G.M. (1978). Time series analysis: Forecasting and
control. San Francisco: Holden-Day. Biometrika, 60(2), 297-303.
doi:10.1093/biomet/65.2.297
.
Kennedy, P. (1992). Forecasting with dynamic regression models: Alan Pankratz, 1991.
International Journal of Forecasting. 8(4), 647-648.
url: https://EconPapers.repec.org/RePEc:eee:intfor:v:8:y:1992:i:4:p:647-648
.
# NOT RUN {
library(astsa)
# A seasonal Random-walk model.
sf1 = stan_naive(birth,seasonal = TRUE,iter = 500,chains = 1)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab