coefs.start {BTSR} | R Documentation |
Initial values for coefficients
Description
Generates initial values for coefficients in BTSR models.
Usage
coefs.start(model, yt, y.start = NULL, y.lower = 0, y.upper = 1,
xreg = NULL, p = 0, q = 0, d = FALSE, map = .default.map.barc,
lags = NULL, fixed.values = NULL, fixed.lags = NULL,
linkg = "linear", configs.linkg = NULL)
Arguments
model |
character string (case-insensitive) indicating the model to be fitted to the data. Must be one of the options listed in the Section Supported Models. |
yt |
numeric vector with the observed time series. Missing values (NA's) are not allowed. |
y.start |
optional; an initial value for |
y.lower |
the lower limit for the Kumaraswamy density support. Default
is |
y.upper |
the upper limit for the Kumaraswamy density support. Default
is |
xreg |
optional; external regressors. Can be specified as a vector, a
matrix or a list. Default is |
p |
the AR order. Default is |
q |
the MA order. Default is |
d |
a length 1 (legacy format) or 2 (new format) logical vector
indicating whether the long memory parameter |
map |
a non-negative integer from 1 to 5 corresponding to the map
function. Default is |
lags |
optional; specification of which lags to include in the model. For one dimensional coefficients, the lag is obviously always 1 and can be suppressed. Can be specified in one of two ways
Default is |
fixed.values |
optional; specification of fixed parameter values. Can be specified in one of two ways
If fixed values are provided and there exists more than one possible lag,
either |
fixed.lags |
optional; specification of which lags should be fixed. For one dimensional coefficients, the lag is obviously always 1 and can be suppressed. Can be specified in one of two ways
For missing components, fixed values will are set based on |
linkg |
specification of link functions. Can be specified in one of two ways
Default is |
configs.linkg |
a list with two elements, |
Details
Parameter initialization is done as follows.
Legacy flat lists are converted to nested
part1
/part2
format. Link functions and density bounds are validated.-
Part 1:
\mu_t
related parameters.A linear model is used to estimate
\alpha
,\boldsymbol \beta
and\boldsymbol \phi
by setting\boldsymbol{Y} = \begin{pmatrix} Y_1 \\ \vdots \\ Y_n \end{pmatrix} \quad \text{and} \quad D = \begin{pmatrix} 1 & X_{11} & \cdots & X_{1s} & g_{12}(Y_0) & \cdots & g_{12}(Y_{1-p}) \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ 1 & X_{n1} & \cdots & X_{ns} & g_{12}(Y_{n-1}) & \cdots & g_{12}(Y_{n-p}) \end{pmatrix}
where
s
is the number of regressors andp
is the AR order, and solving the linear regression problem\boldsymbol{Y} = D\boldsymbol{\gamma} + \boldsymbol{\epsilon}
vialm.fit
.MA coefficients
\boldsymbol{\theta}
are initialized to zero (though small non-zero values may help with optimization stability)The long-memory parameter
d
starts at 0.01 when estimatedFor BARC models:
Map parameters use:
+-------+-------+-------+-------+-------+-------+ | map | 1 | 2 | 3 | 4 | 5 | +-------+-------+-------+-------+-------+-------+ | theta | 3 | 0.5 | 3.5 | 0.5 | NA | +-------+-------+-------+-------+-------+-------+
-
u_0
defaults to\pi/4
when not fixed
-
Part 2:
\nu_t
related parameters.If presented and not time varying,
\nu
is initialized as follows:-
\nu = 5
, for the Kumaraswamy and the Unit-Weibull distributions, -
\nu = \displaystyle\frac{1}{n}\sum_{t=1}^n\dfrac{\hat \mu_t (1 - \hat \mu_t)}{\sigma^2} - 1
, for the Beta distribution, -
\nu = \displaystyle\frac{1}{n}\sum_{t=1}^n\frac{\hat \mu_t^2}{\sigma^2}
, for the Gamma distribution
where
(\hat\mu_1, \cdots, \hat\mu_n)' = D\hat{\boldsymbol{\gamma}}
are the fitted values from the regression model and\sigma^2
is the estimated variance of the residuals.If
\nu
is time varying,set
\alpha
asg_{12}(g_2(\nu))
, with\nu
estimated as in the case where the parameter does not vary on time.set
\boldsymbol{\beta}
,\boldsymbol{\phi}
and\boldsymbol{\theta}
to zero.The long-memory parameter
d
starts at 0.01 when estimated.
-
Value
For models where \nu_t
is not time-varying, returns a list (legacy
format) 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 parameter associate to the map function. For any other model, the MA coefficients. |
d |
the long memory parameter. |
nu |
distribution related parameter (usually, the precision). |
u0 |
for BARC models, the initial value of the iterated map. |
For models where \nu_t
is time-varying, returns a list whose elements
are part1
and part2
. Each element is a list with starting values for the
parameters corresponding to each part o the selected model. Possible outputs
for each part are the same as for the legacy format.
Examples
mu <- 0.5
nu <- 20
yt <- rbeta(100, shape1 = mu * nu, shape2 = (1 - mu) * nu)
# using the general model BARFIMA
coefs.start(model = "BARFIMA", yt = yt, linkg = "linear")
# same output as the specific model BETA
coefs.start(model = "BETA", yt = yt, linkg = "linear")
yt <- rgamma(100, shape = nu, scale = mu / nu)
coefs.start(model = "GARFIMA", yt = yt, linkg = "linear")