| EstPSTR | R Documentation |
EstPSTR estimates either a nonlinear PSTR model (when iq is provided) or a
linear fixed-effects panel regression (when iq = NULL).
EstPSTR(
use,
im = 1,
iq = NULL,
par = NULL,
useDelta = FALSE,
vLower = 2,
vUpper = 2,
method = "L-BFGS-B"
)
use |
An object of class |
im |
Integer. Number of switches |
iq |
Either an integer index (column number in the transition-variable matrix) or a
character string (transition-variable name) specifying which transition variable to use.
If |
par |
Numeric vector of length |
useDelta |
Logical. If |
vLower |
Numeric scalar or vector. Lower offsets defining the lower bounds in the optimiser.
Bounds are applied to the internal parameter vector used in optimisation (with the first
element being |
vUpper |
Numeric scalar or vector. Upper offsets defining the upper bounds in the optimiser.
Bounds are applied to the internal parameter vector used in optimisation (with the first
element being |
method |
Character. Optimisation method passed to |
Two equivalent interfaces are available:
Wrapper function: EstPSTR(use = obj, ...).
R6 method: obj$EstPSTR(...).
The wrapper calls the corresponding R6 method and returns use invisibly.
The transition function is logistic and depends on a transition variable q_{it} and
nonlinear parameters \gamma > 0 and switching locations c_1 < \cdots < c_m:
g(q_{it}; \gamma, c_1,\ldots,c_m) = \left(1 + \exp\left[-\gamma \prod_{j=1}^{m}(q_{it}-c_j)\right]\right)^{-1}.
The smoothness parameter is internally reparametrised as \gamma = \exp(\delta), where
\delta \in \mathbb{R}. The optimisation is always carried out in \delta and c.
If par = NULL, the function constructs default initial values from quantiles of the
selected transition variable and treats the first element as \delta.
Invisibly returns use with estimation results added. In particular, for a
nonlinear PSTR model (iq not NULL), the object contains (among others):
deltaEstimate of \delta.
gammaEstimate of \gamma = \exp(\delta).
cEstimates of c_1,\ldots,c_m.
vgEstimated transition-function values g_{it}.
betaEstimated coefficients (named as var_0 for linear-part coefficients and var_1 for nonlinear-part coefficients).
vUResiduals.
vMEstimated individual effects.
s2Estimated residual variance.
covCluster-robust and heteroskedasticity-consistent covariance matrix of all estimates.
seStandard errors corresponding to est.
estVector of all estimates (coefficients followed by nonlinear parameters).
mbetaEstimates of coefficients in the second extreme regime (when available).
mseStandard errors for mbeta (when available).
For a linear fixed-effects model (iq = NULL), the object contains beta, vU,
vM, s2, cov, se, and est.
NewPSTR, LinTest, WCB_LinTest,
EvalTest, stats::optim.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20,
indep_k = c("vala","debta","cfa","sales"),
tvars = c("vala"), iT = 14)
# 1) Linear fixed-effects model
pstr <- EstPSTR(use = pstr)
print(pstr, mode = "estimates", digits = 6)
# 2) Nonlinear PSTR model
pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE,
par = c(.63, 0), vLower = 4, vUpper = 4)
print(pstr, mode = "estimates", digits = 6)
# R6 method interface (equivalent)
pstr$EstPSTR(im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), method = "CG")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.