This function implements the Theta method using a Generalized Linear Model (GLM)

glmthetaf(
  y,
  h = ifelse(frequency(y) > 1, 2 * frequency(y), 10),
  level = 95L,
  fit_func = stats::glm,
  fan = FALSE,
  x = y,
  type_pi = c("conformal-split", "conformal-surrogate", "conformal-kde",
    "conformal-bootstrap", "conformal-block-bootstrap", "conformal-fitdistr", "gaussian"),
  attention = TRUE,
  scale_ctxt = 1,
  B = 250L,
  nsim = B,
  ...
)

Arguments

y

The time series data

h

The number of periods to forecast

level

The confidence level for the forecast intervals

fit_func

The function to use for fitting the GLM

fan

Logical flag for fan plot

x

The time series data

attention

Logical flag for using attention mechanism

scale_ctxt

Scaling coefficient for context vector

B

Number of bootstrap replications or number of simulations (yes, 'B' is unfortunate)

nsim

Alias for B

...

Additional arguments to pass to the fit_func

Value

A forecast object