DPTS
can fit the dynamic panel threshold model with fixed effects proposed
by Ramírez-Rondán (2020), and also allow a multiple threshold model by setting
Th
> 1.
Given the diverse forms and versatile applications of threshold models, we advocate for aligning model selection with specific research objectives, thereby granting users autonomy in specifying the model structure.
Take the model with one threshold (Ramírez-Rondán, 2020) as example.
For a standard threshold model
$$\begin{aligned}y_{i t} &=\left(\rho_1 y_{i t-1}+\beta_1 x_{i t}\right) I\left(q_{i t}\leq \gamma\right)+\left(\rho_2 y_{i t-1}+\beta_2 x_{i t}\right) I\left(q_{i t}> \gamma\right)\\&+\alpha_i+u_{i t},\end{aligned}$$,
can use DPTS(y~x,data = data, q = q, Th = 1)
.
For a threshold model who has regressors with threshold effects (\(x\)) and regressors without threshold effects (\(z\))
$$\begin{aligned}y_{i t} &=\left(\rho_1 y_{i t-1}+\beta_1 x_{i t}\right) I\left(q_{i t}\leq \gamma\right)+\left(\rho_2 y_{i t-1}+\beta_2 x_{i t}\right) I\left(q_{i t}> \gamma\right)\\&+\theta z_{i t}+\alpha_i+u_{i t},\end{aligned}$$,
can use DPTS(y~x,y~z,data = data, q = q, Th = 1)
.
If user only cares about the regressors with threshold effects (thus hopes there is no threshold effects in the lag of dependent variable \(y_1\)), like
$$\begin{aligned}y_{i t} &= \rho y_{i t-1}+ \beta_1 x_{i t} I\left(q_{i t}\leq \gamma\right)+\beta_2 x_{i t} I\left(q_{i t}> \gamma\right)\\&+\theta z_{i t}+\alpha_i+u_{i t},\end{aligned}$$,
can use DPTS(y~x,y~z,data = data, q = q, Th = 1, NoY = TRUE)
.
And, the threshold model with the following form
$$\begin{aligned}y_{i t} &=\rho_1 y_{i t-1}I\left(q_{i t}\leq \gamma\right)+\rho_2 y_{i t-1}I\left(q_{i t}> \gamma\right)+\beta x_{i t}\\&+\theta z_{i t}+\alpha_i+u_{i t},\end{aligned}$$,
is also allowed by DPTS(NULL,y~x+z,data = data, q = q, Th = 1)
.
In addition, a special threshold model having the following form
$$\begin{aligned}\Delta y_{i t} &=\left(\rho_1 y_{i t-1}+\beta_1 x_{i t}\right) I\left(q_{i t}\leq \gamma\right)+\left(\rho_2 y_{i t-1}+\beta_2 x_{i t}\right) I\left(q_{i t}> \gamma\right)\\&+\theta z_{i t}+\alpha_i+u_{i t},\end{aligned}$$,
can use DPTS(dy~x,dy~z,data = data, q = q, Th = 1)
with y1
\(= y_{it-1}\).
The MCMC we used is based on BayesianTools, and the default method is "DREAMzs" (see Vrugt et al., 2009).
If user wants to use other MCMC, can use ...
(see BayesianTools::applySettingsDefault).
As for the length of iterations, it can be set by iterations
(50% used for burnining) and default length is 2000.
The trace plot and the Gelman and Rubin's convergence diagnostic are supplied by DPTS
(print
) to test the convergence of MCMC sample.
Additionally, we assume the exogenous regressor \(x\) is weakly exogenous, and
thus the first period after difference is given by
$$\Delta y_{i1}=\delta_0 + {\boldsymbol\delta}'_1 \Delta {\bf x}_{i1}+ v_{i1},$$
where \(E(v_{i1}| \Delta {\bf x}_{i1} )=0\). \(E(v_{i1}^2)=\sigma^2_v\),
\(E(v_{i1}\Delta u_{i2})=-\sigma^2_u\) and \(E(v_{i1} \Delta u_{it})=0\)
for \(t=3,4,...,T\) and \(i=1,...,N\).
For more details, see Hsiao et al. (2002).
Finally, we solve the log-likelihood function by stats::nlm
who uses iterlim
to set the maximum number of iterations, and thus iterlim
is allowed by ...
in DPTS
.