coefs.start {BTSR}R Documentation

Initial values for optimization

Description

This function calculates initial values for the parameter vector, to pass to the optimization function.

Usage

coefs.start(model = "Generic", yt, linkg = c("linear", "linear"),
  xreg = NULL, p = 0, q = 0, d = TRUE, y.start = NULL,
  y.lower = -Inf, y.upper = Inf, lags = list(), fixed.values = list(),
  fixed.lags = list())

Arguments

model

character; The model to be fitted to the data. One of "BARFIMA", "KARFIMA", "GARFIMA", "BARC". Default is "Generic" so that no specific structure is assumed.

yt

a univariate time series. Missing values (NA's) are not allowed.

linkg

character; one of "linear", "logit", "log", "loglog", "cloglog". If only one name is provided, the same link will be used for the conditional mean, that is to define g(\mu) and for the observed time series in the AR part of the model, that is, g(y[t]).

xreg

optional; a vector or matrix of external regressors, which must have the same number of rows as x.

p

an integer; the AR order. Default is zero.

q

an integer; for BARC models represents the dimension of the parameter associated to the map T. For other models is the MA order. Default is zero.

d

logical; if FALSE, d is fixed as zero. Default is TRUE.

y.start

optional; an initialization value for y[t], for t \le 0, to be used in the AR recursion. If not provided, the default assume y[t] = 0, when using a "linear" link for yt, and g(y[t]) = 0, otherwise.

y.lower

lower limit for the distribution support. Default is -Inf.

y.upper

upper limit for the distribution support. Default is Inf.

lags

optional; a list with the components beta, phi and theta specifying which lags must be included in the model. An empty list or missing component indicates that, based on the values nreg, p e q), all lags must be includes in the model.

fixed.values

optional; a list with the fixed values for each component, if any. If fixed values are provided, either lags or fixed.lags must also be provided.

fixed.lags

optional; a list with the components beta, phi and theta specifying which lags must be fixed. An empty list implies that fixed values will be set based on lags.

Value

a list with starting values for the parameters of the selected model. Possible outputs are:

alpha

the intercept

beta

the coefficients for the regressors

phi

the AR coefficients

theta

for BARC models, the map parameter. For any other model, the MA coefficients

d

the long memory parameter

nu

the precison parameter

Examples

mu = 0.5
nu = 20

yt = rbeta(100, shape1 = mu*nu, shape2 = (1-mu)*nu)
coefs.start(model = "BARFIMA", yt = yt,
            linkg = "linear", d = FALSE,
            y.lower = 0, y.upper = 1)

yt = rgamma(100, shape = nu, rate = mu*nu)
coefs.start(model = "GARFIMA", yt = yt,
            linkg = "linear", d = FALSE,
            y.lower = 0, y.upper = Inf)


[Package BTSR version 0.1.5 Index]