Abstract
We propose a general recursive algorithm for the computation of the conditional probability function of the quadratic exponential model for binary panel data given the total of the responses, which is a sufficient statistic for the individual intercept parameter. This recursion permits to implement conditional and pseudo-conditional maximum likelihood estimators of the parameters of this model, and related models such as the dynamic logit model, even when one or more statistical units are observed at many occasions. In this way we solve a typical problem in dealing with distributions with a complex normalizing constant. The advantage in terms of computational load with respect to standard techniques is assessed by simulation and illustrated by an application based on a popular dataset about brand loyalty.
Similar content being viewed by others
Data Availability
Data used in Sect. 5 are publicly available at https://cran.r-project.org/package=Ecdat.
Code Availability
Custom code included in the R package https://cran.r-project.org/package=cquad.
Notes
Available for the software R (https://cran.r-project.org/package=cquad) and Stata (https://ideas.repec.org/c/boc/bocode/s458852.html, https://github.com/fravale/cquadr).
Data are publicly available in the R package Ecdat (https://cran.r-project.org/web/packages/Ecdat/index.html).
References
Agresti, A. (2003). Categorical Data Analysis, (Vol. 482). Wiley.
Andersen, E. B. (1970). Asymptotic properties of conditional maximum-likelihood estimators. Journal of the Royal Statistical Society: Series B, 32, 283–301.
Andersen, E. B. (1971). The asymptotic distribution of conditional likelihood ratio tests. Journal of the American Statistical Association, 66, 630–633.
Andersen, E. B. (1972). The numerical solution of a set of conditional estimation equations. Journal of the Royal Statistical Society: Series B, 34, 42–54.
Arellano, M., & Hahn, J. (2016). A likelihood-based approximate solution to the incidental parameter problem in dynamic nonlinear models with multiple effects. Global Economic Review, 45, 251–274.
Arellano, M., & Honoré, B. (2001). Panel data models: some recent developments. In: Handbook of Econometrics, vol 5, Elsevier, pp 3229–3296.
Baetschmann, G., Staub, K. E., & Winkelmann, R. (2015). Consistent estimation of the fixed effects ordered logit model. Journal of the Royal Statistical Society: Series A, 178, 685–703.
Bartolucci, F., & Nigro, V. (2010). A dynamic model for binary panel data with unobserved heterogeneity admitting a \(\sqrt{n}\)-consistent conditional estimator. Econometrica, 78, 719–733.
Bartolucci, F., & Nigro, V. (2012). Pseudo conditional maximum likelihood estimation of the dynamic logit model for binary panel data. Journal of Econometrics, 170, 102–116.
Bartolucci, F., & Pennoni, F. (2007). On the approximation of the quadratic exponential distribution in a latent variable context. Biometrika, 94, 745–754.
Bartolucci, F., & Pigini, C. (2017). cquad: An R and Stata package for conditional maximum likelihood estimation of dynamic binary panel data models. Journal of Statistical Software, 78(7)
Bartolucci, F., Bacci, S., & Gnaldi, M. (2015). Statistical Analysis of Questionnaires: A Unified Approach Based on R and Stata. Chapman and Hall/CRC.
Bartolucci, F., Bellio, R., Salvan, A., & Sartori, N. (2016). Modified profile likelihood for fixed-effects panel data models. Econometric Reviews, 35, 1271–1289.
Bartolucci, F., Nigro, V., & Pigini, C. (2018). Testing for state dependence in binary panel data with individual covariates by a modified quadratic exponential model. Econometric Reviews, 37, 61–88.
Besag, J. (1974). Spatial interaction and the statistical analysis of lattice systems. Journal of the Royal Statistical Society: Series B, 36, 192–225.
Bester, C. A., & Hansen, C. (2009). A penalty function approach to bias reduction in nonlinear panel models with fixed effects. Journal of Business & Economic Statistics, 27, 131–148.
Carro, J. M. (2007). Estimating dynamic panel data discrete choice models with fixed effects. Journal of Econometrics, 140, 503–528.
Chamberlain, G. (1980). Analysis of covariance with qualitative data. Review of Economic Studies, 47, 225–238.
Chamberlain, G. (1993). Feedback in panel data medels. Harvard-Institute of Economic Research: Tech. rep.
Charbonneau, K. B. (2017). Multiple fixed effects in binary response panel data models. The Econometrics Journal, 20, S1–S13.
Chintagunta, P., Kyriazidou, E., & Perktold, J. (2001). Panel data analysis of household brand choices. Journal of Econometrics, 103, 111–153.
Cox, D. R. (1972a). The analysis of multivariate binary data. Applied Statistics, 21, 113–120.
Cox, D. R. (1972b). Regression models and life-tables. Journal of the Royal Statistical Society: Series B, 34, 187–202.
De Paula, Á. (2020). Econometric models of network formation. Annual Review of Economics, 12, 775–799.
Dhaene, G., & Jochmans, K. (2015). Split-panel jackknife estimation of fixed-effect models. The Review of Economic Studies, 82, 991–1030.
Diggle, P. J., Heagerty, P., Liang, K. Y., Heagerty, P. J., Zeger, S., et al. (2002). Analysis of Longitudinal Data. Oxford University Press.
Fernández-Val, I. (2009). Fixed effects estimation of structural parameters and marginal effects in panel probit models. Journal of Econometrics, 150, 71–85.
Graham, B. S. (2017). An econometric model of network formation with degree heterogeneity. Econometrica, 85, 1033–1063.
Gustafsson, J. E. (1980). A solution of the conditional estimation problem for long tests in the Rasch model for dichotomous items. Educational and Psychological Measurement, 40, 377–385.
Hahn, J., & Kuersteiner, G. (2011). Bias reduction for dynamic nonlinear panel models with fixed effects. Econometric Theory, 27, 1152–1191.
Hahn, J., & Newey, W. (2004). Jackknife and analytical bias reduction for nonlinear panel models. Econometrica, 72, 1295–1319.
Hambleton, R. K., & Swaminathan, H. (1986). Item Response Theory: Principles and Applications. Springer Science & Business Media.
Heckman, JJ. (1981). Heterogeneity and state dependence. In: Studies in labor markets, University of Chicago Press, pp 91–140.
Honoré, B. E., & Kyriazidou, E. (2000). Panel data discrete choice models with lagged dependent variables. Econometrica, 68, 839–874.
Howard, S. (1972). Remark on the paper by Cox, D. R. (1972): Regression methods and life tables. Journal of the Royal Statistical Society: Series B, 34, 187–202.
Hsiao, C. (2014). Analysis of Panel Data. Cambridge University Press.
Jain, D. C., Vilcassim, N. J., & Chintagunta, P. K. (1994). A random-coefficients logit brand-choice model applied to panel data. Journal of Business & Economic Statistics, 12, 317–328.
Jochmans, K. (2018). Semiparametric analysis of network formation. Journal of Business & Economic Statistics, 36(4), 705–713.
Krailo, M., & Pike, M. (1984). Algorithm AS 196: conditional multivariate logistic analysis of stratified case-control studies. Journal of the Royal Statistical Society Series C, 33, 95–103.
Lancaster, T. (2000). The incidental parameter problem since 1948. Journal of Econometrics, 95, 391–413.
Levin, B. (1987). Conditional likelihood analysis in stratum-matched retrospective studies with polytomous disease states. Communications in Statistics: Simulation and Computation, 16, 699–718.
Lindsay, B., Clogg, C. C., & Grego, J. (1991). Semiparametric estimation in the rasch model and related exponential response models, including a simple latent class model for item analysis. Journal of the American Statistical Association, 86(413), 96–107.
Neyman, J., & Scott, E. L. (1948). Consistent estimates based on partially consistent observations. Econometrica, 16, 1–32.
Rasch, G. (1960). Probabilistic Models for Some Intelligence and Attainment Tests. Danish Institute for Educational Research.
Rasch, G. (1961). On general laws and the meaning of measurement in psychology. Proceedings of the fourth Berkeley symposium on mathematical statistics and probability, 4, 321–333.
Smith, P., Pike, M., Hill, A., Breslow, N., & Day, N. (1981). Algorithm AS 162: Multivariate conditional logistic analysis of stratum-matched case-control studies. Journal of the Royal Statistical Society: Series C, 30, 190–197.
Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data, MIT Press Books, (Vol. 1). The MIT Press.
Zhang, D., & Davidian, M. (2004). Likelihood and conditional likelihood inference for generalized additive mixed models for clustered data. Journal of Multivariate Analysis, 91(1), 90–106.
Funding
F. Bartolucci acknowledges the financial support from the grant “Partial effects in econometric models for binary longitudinal data based on quadratic exponential distributions” of the University of Perugia (RICBASE2018).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflicts of interest
The authors have no conflicts of interest to declare that are relevant to the content of this article.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix: Derivatives
In the following, we report the first and second derivatives for the relevant functions of the proposed recursive algorithm for the static logit, simplified, modified, and approximating QE models. These derivatives are then used to compute the score vector and Information matrix involved in the steps of the Newton-Raphson algorithm, in order to maximize the conditional log-likelihoods.
Static Logit Model
Concerning computation of the derivatives presented in Sect. 3.1 we can exploit the same recursive structure presented in Eq. (17), so that:
-
1.
for \(t=1\) the first derivatives are
$$\begin{aligned} f^{(h)}_{1,0}({\varvec{\phi }})&= 0,\quad h=1,\ldots ,T_i,\\ f^{(h)}_{1,1}({\varvec{\phi }})&= \left\{ \begin{array}{ll} \exp (\phi _1), & h=1, \\ 0, & \text{otherwise}, \end{array}\right. \\ \end{aligned}$$and the second derivatives are
$$\begin{aligned} f^{(h,j)}_{1,0}({\varvec{\phi }})&= 0,\quad h,j=1,\ldots ,T_i,\\ f^{(j,j)}_{1,1}({\varvec{\phi }})&= \left\{ \begin{array}{ll}\exp (\phi _1),& h=j=1,\\ 0, & \text{otherwise}; \end{array}\right. \end{aligned}$$ -
2.
for \(t=2,\ldots ,T_i\) and \(s=1,\ldots ,t\), are the first derivatives are
$$\begin{aligned} f^{(h)}_{t,0}({\varvec{\phi }})&= {} 0,\quad h=1,\ldots ,T_i,\\ f^{(h)}_{t,s}({\varvec{\phi }})&= {} \left\{ \begin{array}{ll} f_{t-1,s}^{(h)}({\varvec{\phi }})+f_{t-1,s-1}^{(h)}({\varvec{\phi }})\exp (\phi _t), &{} h=1,\ldots ,t-1,\\ f_{t-1,s-1}({\varvec{\phi }})\exp (\phi _t), &{} h=t, \\ 0, &{} \text{otherwise}, \end{array}\right. \end{aligned}$$and second derivatives are
$$\begin{aligned}&f^{(h,j)}_{t,0}({\varvec{\phi }}) = 0, \quad h,j=1,\ldots ,T_i, \\&f^{(h,j)}_{t,s}({\varvec{\phi }}) = \left\{ \begin{array}{ll} f_{t-1,s}^{(h,j)}({\varvec{\phi }})+f_{t-1,s-1}^{(h,j)}({\varvec{\phi }})\exp (\phi _t), &{} h,j=1,\ldots ,t-1,\\ f_{t-1,s-1}^{(h)}({\varvec{\phi }})\exp (\phi _t), &{} h=1,\ldots ,t-1,\, j=t\\ f_{t-1,s-1}^{(j)}({\varvec{\phi }})\exp (\phi _t), &{} h=t,\,j=1,\ldots ,t-1, \\ f_{t-1,s-1}({\varvec{\phi }})\exp (\phi _t), &{} h=j=t, \\ 0, &{} \text{otherwise}. \end{array}\right. \end{aligned}$$
Simplified QE Model
As for the static model, define now the first and the second derivatives
respectively, where these quantities are computed for \(h,j=1,\ldots ,T_i\), \(s=0,\ldots ,t\), and \(t=1,\ldots ,T_i\) and where we further define \(\phi _{T_i+1}=\psi \) in order to include the derivative with respect to the state dependence parameter which is an additional argument of our function further to the \(T_i\) elements of \({\varvec{\phi }}\).
Regarding the first derivatives of the function defined in (19), we exploit the same recursion:
-
1.
when \(t=1\) compute
$$\begin{aligned} g_{1,a,s,v}^{(h)}({\varvec{\phi }},\psi )=\left\{ \begin{array}{ll} \exp (\phi _1+a\psi ),&{} h=1,\\ a\exp (\phi _1+a\psi ), &{} h=T_i+1, \end{array}\right. \end{aligned}$$for \(a=0,1\) and \(s=v=1\) and \(g_{1,a,s,v}^{(h)}=0\) in all other cases;
-
2.
when \(t=2,\ldots ,T_i\) consider the following cases:
-
for \(s=1,\ldots ,t-1\) and \(v=0\):
$$\begin{aligned}&g^{(h)}_{t,a,s,v}({\varvec{\phi }},\psi )= g_{t-1,a,s,0}^{(h)}({\varvec{\phi }},\psi )+g_{t-1,a,s,1}^{(h)}({\varvec{\phi }},\psi ), \quad h=1,\ldots ,t-1,T_i +1; \end{aligned}$$ -
for \(s=1,\ldots ,t\), \(v=1\),
$$\begin{aligned}&g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi ) \\&\quad =\left\{ \begin{array}{ll} g_{t-1,a,s-1,0}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t)+ g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=1,\ldots ,t-1,\\ \\ g_{t,a,s,v}({\varvec{\phi }},\psi ),&{}h=t,\\ \\ g_{t-1,a,s-1,0}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad +g_{t-1,a,s-1,1}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=T_i+1;\end{array}\right. \end{aligned}$$ -
\(g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi )=0\) in all other cases.
-
Regarding the second derivatives, we have:
-
1.
when \(t=1\) compute
$$\begin{aligned} g_{1,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )=\left\{ \begin{array}{ll} \exp (\phi _1+a\psi ),&{} h=j=1,\\ a\exp (\phi _1+a\psi ),&{} h=1,\,j=T_i+1,\\ a\exp (\phi _1+a\psi ), &{} h=T_i+1,\,j=1,\\ a\exp (\phi _1+a\psi ), &{} h,j=T_i+1, \end{array}\right. \end{aligned}$$for \(a=0,1\) and \(s=v=1\) and \(g_{1,a,s,v}^{(h)}=0\) in all other cases.
-
2.
when \(t=2,\ldots ,T_i\) consider the following cases:
-
for \(s=1,\ldots ,t-1\) and \(v=0\),
$$\begin{aligned}&g^{(h,j)}_{t,a,s,v}({\varvec{\phi }},\psi )= g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\psi )+g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\psi ), \quad h,j=1,\ldots ,t-1,T_i+1; \end{aligned}$$ -
for \(s=1,\ldots ,t\), \(v=1\),
$$\begin{aligned}&g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )\\&\quad =\left\{ \begin{array}{ll} g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h,j=1,\ldots ,t-1,\\ \\ g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi ), &{} h=1,\ldots ,t-1,\,j=t,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), \\ \quad +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=1,\ldots ,t-1,\,j=T_i+1,\\ \\ g^{(j)}_{t,a,s,v}({\varvec{\phi }},\psi ), \quad \quad h=t,\,j=1,\ldots ,t,T_i+1,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t)+ g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad +g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=T_i+1,\,j=1,\ldots ,t-1\\ \\ g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi ), &{} h=T_i+1,\,j=t,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) + g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ) +g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad \quad \quad \quad +g_{t-1,a,s-1,1}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=T_i+1,\,j=T_i+1; \end{array}\right. \end{aligned}$$ -
\(g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )=0\) in all other cases.
-
Modified QE Model
Regarding the first derivatives of the function reported in Eq. (20), we exploit the same recursion:
-
1.
with \(t=1\)
-
for \(s=v=0\) compute
$$\begin{aligned}&g_{1,a,s,v}^{(h)}({\varvec{\phi }},\psi )\\&\quad =\left\{ \begin{array}{ll} 0,&{} h=1,\\ (1-a)\exp[\phi _1+ (1-a)\psi ], &{} h=T_i+1; \end{array}\right. \end{aligned}$$ -
for \(s=v=1\) compute
$$\begin{aligned}&g_{1,a,s,v}^{(h)}({\varvec{\phi }},\psi )\\&\quad =\left\{ \begin{array}{ll} \exp (\phi _1+ a\psi ),&{} h=1,\\ a\exp (\phi _1+ a\psi ), &{} h=T_i+1; \end{array}\right. \end{aligned}$$ -
\(g_{1,a,s,v}^{(h)}=0\) in all other cases.
-
-
2.
with \(t=2,\ldots ,T_i\) consider the following cases:
-
for \(s=0,\ldots ,t-1\) and \(v=0\),
$$\begin{aligned}&g^{(h)}_{t,a,s,v}({\varvec{\phi }},\psi )\\&\quad =\left\{ \begin{array}{ll} 0, &{} h = 1,\ldots ,t-1,\\ \\ g_{t-1,a,s,0}^{(h)}({\varvec{\phi }},\psi )\exp (\psi ) + g_{t-1,a,s,0}\exp (\psi )\\ \quad +g_{t-1,a,s,1}^{(h)}({\varvec{\phi }},\psi ), &{} h=T_i+1;\\ \end{array}\right. \end{aligned}$$ -
for \(s=1,\ldots ,t\), \(v=1\),
$$\begin{aligned}&g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi )\\&\quad =\left\{ \begin{array}{ll} g_{t-1,a,s-1,0}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ) \\ \quad +g_{t-1,a,s-1,0}({\varvec{\phi }},\psi )\exp (\phi _t)\\ \quad \quad +g_{t-1,a,s-1,1}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=1,\ldots ,t,\\ \\ g_{t-1,a,s-1,0}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad +g_{t-1,a,s-1,1}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=T_i+1;\end{array}\right. \end{aligned}$$
-
-
3.
\(g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi )=0\) in all other cases.
Regarding the second derivatives, we have:
-
1.
for \(t=1\) and \(v=0\) compute
$$\begin{aligned} g_{1,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )=\begin{array}{ll} (1-a)\exp [(1-a)\psi ],&h,j=T_i+1; \end{array} \end{aligned}$$ -
2.
for \(t=1\) and \(v=1\) compute
$$\begin{aligned} g_{1,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )=\left\{ \begin{array}{ll} \exp (\phi _1+ a\psi ),&{} h=j=1,\\ a\exp (\phi _1+ a\psi ),&{} h=1,\,j=T_i+1,\\ a\exp (\phi _1+ a\psi ), &{} h=T_i+1,\,j=1,\\ a\exp (\phi _1+ a\psi ), &{} h,j=T_i+1; \end{array}\right. \end{aligned}$$for \(a=0,1\) and \(s=v=1\) and \(g_{1,a,s,v}^{(h)}=0\) in all other cases.
-
3.
for \(t=2,\ldots ,T_i\) consider the following cases:
-
for \(s=1,\ldots ,t-1\) and \(v=0\),
$$\begin{aligned}&g^{(h,j)}_{t,a,s,v}({\varvec{\phi }},\psi )\\&\quad = \left\{ \begin{array}{ll} g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\psi ) +\exp (\psi )+g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\psi ) &{} h = j = 1,\ldots ,t-1;\\ \\ g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\psi ) +\exp (\psi )+g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\psi )\\ \quad + g_{t-1,a,s,0}^{(h)}({\varvec{\phi }},\psi )\exp (\psi ), &{} h=1,\ldots ,t-1,j = T_i+1;\\ \\ g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\psi ) +\exp (\psi )+g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\psi )\\ \quad + g_{t-1,a,s,0}^{(j)}({\varvec{\phi }},\psi )\exp (\psi ), &{} j=1,\ldots ,t-1,h = T_i+1;\\ \\ g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\psi ) +\exp (\psi )+g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\psi )\\ \quad + g_{t-1,a,s,0}^{(h)}({\varvec{\phi }},\psi )\exp (\psi ) + g_{t-1,a,s,0}^{(j)}({\varvec{\phi }},\psi )\exp (\psi )\\ \quad \quad + g_{t-1,a,s,0}({\varvec{\phi }},\psi )\exp (\psi ),&{} j = h = T_i+1. \end{array}\right. \end{aligned}$$ -
for \(s=1,\ldots ,t\), \(v=1\),
$$\begin{aligned}&g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )\\&\quad = \left\{ \begin{array}{ll} g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h,j=1,\ldots ,t-1,\\ \\ g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi ), &{} h=1,\ldots ,t-1,\,j=t,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), \\ \quad +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=1,\ldots ,t-1,\,j=T_i+1,\\ \\ g^{(j)}_{t,a,s,v}({\varvec{\phi }},\psi ), &{} h=t,\,j=1,\ldots ,t,T_i+1,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad +g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=T_i+1,\,j=1,\ldots ,t-1\\ \\ g_{t,a,s,v}^{(h)}({\varvec{\phi }},\psi ), &{} h=T_i+1,\,j=t,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ) +g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\psi )\exp (\phi _t+\psi )\\ \quad \quad +g_{t-1,a,s-1,1}({\varvec{\phi }},\psi )\exp (\phi _t+\psi ), &{} h=T_i+1,\,j=T_i+1; \end{array}\right. \end{aligned}$$ -
\(g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\psi )=0\) in all other cases.
-
Approximating QE model
Regarding the first derivatives of the function in Eq. (21), compute:
-
1.
with \(t=1\),
-
for \(s=v=0\) and \(a=0,1\),
$$\begin{aligned} g_{1,a,s,v}^{(h)}({\varvec{\phi }},\gamma )=\left\{ \begin{array}{ll} a\exp (a\nu _1)(- {\bar{r}}_{i1}), &{} h=T_i+1,\\ 0, &{} \text{otherwise}; \end{array}\right. \end{aligned}$$ -
for for \(s=v=1\) and \(a=0,1\),
$$\begin{aligned} g_{1,a,s,v}^{(h)}({\varvec{\phi }},\gamma )=\left\{ \begin{array}{ll} \exp (\phi _1+a(\nu _1 + \gamma )),&{} h=1,\\ a\exp (\phi _1+a(\nu _1 + \gamma ))(1 - {\bar{r}}_{i1}), &{} h=T_i+1; \end{array}\right. \end{aligned}$$ -
\(g_{1,a,s,v}^{(h)}=0\) in all other cases.
-
-
2.
for \(t=2,\ldots ,T_i\) consider the following cases:
-
for \(s=1,\ldots ,t-1\) and \(v=0\),
$$\begin{aligned}&g_{t,a,s,v}^{(h)}({\varvec{\phi }},\gamma ) \\&\quad =\left\{ \begin{array}{ll} g_{t-1,a,s,0}^{(h)}({\varvec{\phi }},\gamma )+g_{t-1,a,s,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\nu _t), &{} h=1,\ldots ,t,\\ \\ g_{t-1,a,s,0}^{(h)}({\varvec{\phi }},\gamma )+g_{t-1,a,s,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\nu _t)\\ \quad +g_{t-1,a,s,1}({\varvec{\phi }},\gamma )\exp (\nu _t)(-{\bar{r}}_{it}), &{} h=T_i+1;\end{array}\right. \end{aligned}$$ -
for \(s=1,\ldots ,t\), \(v=1\),
$$\begin{aligned}&g_{t,a,s,v}^{(h)}({\varvec{\phi }},\gamma ) \\&\quad =\left\{ \begin{array}{ll} g_{t-1,a,s-1,0}^{(h)}({\varvec{\phi }},\gamma )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad + g_{t-1,a,s-1,0}({\varvec{\phi }},\gamma )\exp (\phi _t) +g_{t-1,a,s-1,1}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma ), &{} h=1,\ldots ,t\\ \\ g_{t-1,a,s-1,0}^{(h)}({\varvec{\phi }},\gamma )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad +g_{t-1,a,s-1,1}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it}), &{} h=T_i+1;\end{array}\right. \end{aligned}$$ -
\(g_{t,a,s,v}^{(h)}({\varvec{\phi }},\gamma )=0\) in all other cases.
-
Following the same approach as above, the second derivatives are:
-
1.
for \(t=1\),
-
with \(v=0\) compute
$$\begin{aligned} g_{1,a,s,0}^{(h,j)}({\varvec{\phi }},\psi )= \begin{array}{ll} a\exp (a\nu _1)(-{\bar{r}}_{i1})^2, &{} h,j=T_i+1;\\ \end{array} \end{aligned}$$ -
while for \(v=1\) we have
$$\begin{aligned}&g_{1,a,s,1}^{(h,j)}({\varvec{\phi }},\psi )\\&\quad =\left\{ \begin{array}{ll} \exp (\phi _1+a(\nu _1 + \gamma )),&{} h=j=1,\\ a\exp (\phi _1+a(\nu _1 + \gamma ))(1-{\bar{r}}_{i1}),&{} h=1,\,j=T_i+1,\\ a\exp (\phi _1+a(\nu _1 + \gamma ))(1-{\bar{r}}_{i1}), &{} h=T_i+1,\,j=1,\\ a\exp (\phi _1+a(\nu _1 + \gamma ))(1-{\bar{r}}_{i1})^2, &{} h,j=T_i+1; \end{array}\right. \end{aligned}$$ -
\(g_{1,a,s,v}^{(h,j)}({\varvec{\phi }},\psi ) = 0\) in other cases.
-
-
2.
with \(t = 2,\dots ,T_i\):
-
for \(s=1\dots t-1\) and \(v=0\), we have:
$$\begin{aligned}&g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\gamma ) \\&\quad = \left\{ \begin{array}{ll} g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\gamma ) +g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\nu _t), &{} h,j=1,\ldots ,t\\ \\ g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\gamma )+g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\nu _t) \\ \quad +g_{t-1,a,s,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\nu _t)(-{\bar{r}}_{it}), &{} h=T_i+1,\,j=1,\ldots ,t\\ \\ g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\gamma ) +g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\nu _t) \\ \quad +g_{t-1,a,s,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\nu _t)(-{\bar{r}}_{it}), &{} h=1,\ldots ,t,\,j=T_i+1,\\ \\ g_{t-1,a,s,0}^{(h,j)}({\varvec{\phi }},\gamma ) +g_{t-1,a,s,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\nu _t) \\ \quad +g_{t-1,a,s,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\nu _t)(-{\bar{r}}_{it}) + g_{t-1,a,s,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\nu _t)(-{\bar{r}}_{it})\\ \quad \quad + g_{t-1,a,s,1}\exp (\nu _t)(-{\bar{r}}_{it})^2, &{} h=T_i+1,\,j=T_i+1; \end{array}\right. \end{aligned}$$ -
for \(s=1\dots t-1\) and \(v=1\), we have:
$$\begin{aligned}&g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\gamma ) \\&\quad = \left\{ \begin{array}{ll} g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad + g^{(h)}_{t-1,a,s-1,0}({\varvec{\phi }},\gamma )\exp (\phi _t) + g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad \quad + g^{(j)}_{t-1,a,s-1,0}({\varvec{\phi }},\gamma )\exp (\phi _t) + g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad \quad \quad +g_{t-1,a,s,0}({\varvec{\phi }},\gamma )\exp (\phi _t) + g_{t-1,a,s,1}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma ), &{} h,j=1,\ldots ,t,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad + g_{t-1,a,s-1,1}^{(h)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it}) +g^{(j)}_{t-1,a,s-1,0}({\varvec{\phi }},\gamma )\exp (\phi _t) \\ \quad \quad + g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma ) \\ \quad \quad \quad + g_{t-1,a,s,1}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it}), &{} h=1,\ldots ,t,\,j=T_i+1,\\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t) +g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad + g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it}) \\ \quad \quad + g^{(h)}_{t-1,a,s-1,0}({\varvec{\phi }},\gamma )\exp (\phi _t) + g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma ) \\ \quad \quad \quad + g_{t-1,a,s,1}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it}), &{} h=1,\ldots ,t,\,j=T_i+1,\\ \\ \\ g_{t-1,a,s-1,0}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t) + g_{t-1,a,s-1,1}^{(h,j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )\\ \quad +g^{(h)}_{t-1,a,s-1,0}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it}) \\ \quad \quad + g_{t-1,a,s-1,1}^{(j)}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it})\\ \quad \quad \quad + g_{t-1,a,s-1,1}({\varvec{\phi }},\gamma )\exp (\phi _t+\nu _t+\gamma )(1-{\bar{r}}_{it})^2, &{}h=T_i+1,\,j=T_i+1; \end{array}\right. \end{aligned}$$
-
-
3.
\(g_{t,a,s,v}^{(h,j)}({\varvec{\phi }},\gamma )=0\) in all other cases.
Rights and permissions
About this article
Cite this article
Bartolucci, F., Valentini, F. & Pigini, C. Recursive Computation of the Conditional Probability Function of the Quadratic Exponential Model for Binary Panel Data. Comput Econ 61, 529–557 (2023). https://doi.org/10.1007/s10614-021-10218-2
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10614-021-10218-2