regimes {hspm} | R Documentation |
Estimation of regimes models
Description
The function regimes
deals with
the estimation of regime models.
Most of the times the variable identifying the regimes
reveals some spatial aspects of the data (e.g., administrative boundaries).
Usage
regimes(formula, data, rgv = NULL, vc = c("homoskedastic", "groupwise"))
Arguments
formula |
a symbolic description of the model of the form |
data |
the data of class |
rgv |
an object of class |
vc |
one of |
Details
For convenience and without loss of generality, we assume the presence of only two regimes. In this case, the basic (non-spatial) is:
where ,
and the
vector
contains the observations
on the dependent variable for the first regime,
and the
vector
(with
)
contains the observations on the dependent variable for the second regime.
The
matrix
and the
matrix
are blocks of a block diagonal matrix,
the vectors of parameters
and
have
dimension
and
, respectively,
is the
matrix of regressors that do not vary by regime,
is a
vector of parameters
and
is the
vector of innovations.
If
vc = "homoskedastic"
, the model is estimated by OLS.If
vc = "groupwise"
, the model is estimated in two steps. In the first step, the model is estimated by OLS. In the second step, the inverse of the (groupwise) residuals from the first step are employed as weights in a weighted least square procedure.
Value
An object of class lm
and spregimes
.
Author(s)
Gianfranco Piras and Mauricio Sarrias
Examples
data("baltim")
form <- PRICE ~ NROOM + NBATH + PATIO + FIREPL + AC + GAR + AGE + LOTSZ + SQFT
split <- ~ CITCOU
mod <- regimes(formula = form, data = baltim, rgv = split, vc = "groupwise")
summary(mod)
form <- PRICE ~ AC + AGE + NROOM + PATIO + FIREPL + SQFT | NBATH + GAR + LOTSZ - 1
mod <- regimes(form, baltim, split, vc = "homoskedastic")
summary(mod)