EstPSTR: Estimate the PSTR model.

View source: R/estimation.R

EstPSTRR Documentation

Estimate the PSTR model.

Description

This function implements the estimation of the PSTR model.

Usage

EstPSTR(
  use,
  im = 1,
  iq = NULL,
  par = NULL,
  useDelta = FALSE,
  vLower = 2,
  vUpper = 2,
  method = "L-BFGS-B"
)

Arguments

use

an object of the class PSTR, created by NewPSTR function.

im

specifies the number of switches in the transtion function. The default value is 1.

iq

a column number (in mQ) or variable name specifying the transition variable to use.

par

initial values for the parameters \gamma or \delta, and c to be optimized over. It is a vector of length im+1, where im is the number of switches. When missing, the function will choose the initial values automatically, and useDelta=TRUE.

useDelta

whether delta is used in par in the estimation. Note that if par is missing, this argument will be ignored.

vLower

a vector or number of the lower offsets determining the lower bounds of the parameters. The lower bounds of the parameters are par - vLower.

vUpper

a vector or number of the upper offsets determining the upper bounds of the parameters. The upper bounds of the parameters are par + vUpper.

method

the method to be used in optimization. See the function stats::optim.

Details

The function needs the return value (an object of the class PSTR) from the NewPSTR. It copies the object, reuses its contents to estimate the correspdonding PSTR model, and then returns a new object of the class PSTR containing the results from the estimation. The user can choose to save the return value to a new object or simply to overwrite the object returned from NewPSTR.

The PSTR model to be estimated takes the logistic form in nonlinearity. Remember the g function in the model. It takes the form

g(q_{it} ; \gamma, c) = \left( 1 + \exp \left( - \gamma \prod_{j=1}^{m} (q_{it} - c_j) \right) \right)^{-1}

with \gamma > 0 and c_1 < c_2 < ... < c_m. \gamma can be reparametrized as \gamma = \exp{\delta} where \delta is a real number.

The user should have obtained the information about which transition variable (q_{it}) to use (from LinTest and/or WCB_LinTest) in estimation before running the function to estimate the model.

The estimation function never change the existing values in the input PSTR object. It adds more values (attributes) into the input object and return.

Value

a new object of the class PSTR containing the results from the estimation.

The object is a list containing the components made in NewPSTR and the following new components:

iq

specify which transition variable will be used in estimation. The default value NULL implies a linear panel regression model.

delta

the estimate of \delta.

c

the estimates of c.

vg

the values of the transition function given the estimates of \delta and c and the transition variables q_{it}.

beta

the estimates of the coefficient parameters.

vU

the residuals.

vM

a vector of the estimated time-invariant individual effect.

s2

the variance of the residuals.

cov

the covariance matrix of the estimates which is cluster-dependency and heteroskedasticity consistent.

est

a vector of all the estimates

se

a vector of the standard errors of all the estimates which is cluster-dependency and heteroskedasticity consistent.

mbeta

a vector of the estimates of the parameters in the second extreme regime.

mse

a vector of the standard errors of the estimates of the parameters in the second extreme regime.

convergence

an integer code showing the convergence, see optim.

par

a vector of the initial values used in the optimization. Note that the first element is always delta, no matter whether gamma is used as input.

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

See Also

NewPSTR, LinTest and WCB_LinTest

Examples


pstr = NewPSTR(Hansen99, dep='inva', indep=4:20, indep_k=c('vala','debta','cfa','sales'),
    tvars=c('vala'), iT=14) # create a new PSTR object

# estimate a linear panel regression model
pstr = EstPSTR(use=pstr)
print(pstr, "estimates", digits=6)

# "L-BFGS-B" is used by default
pstr = EstPSTR(use=pstr, im=1, iq=1, useDelta=TRUE, par=c(.63,0), vLower=4, vUpper=4)
# You can also choose the method yourself.
pstr = EstPSTR(use=pstr, im=1, iq=1, useDelta=TRUE, par=c(.63,0), method='CG')

print(pstr, "estimates", digits=6)

# The estimation of a linear panel regression model with fix effects is also implemented.
pstr0 = EstPSTR(use=pstr)

print(pstr0,"estimates")



yukai-yang/PSTR documentation built on Aug. 25, 2023, 10:14 a.m.