Linear latent variable models: the lava-package

Abstract

An R package for specifying and estimating linear latent variable models is presented. The philosophy of the implementation is to separate the model specification from the actual data, which leads to a dynamic and easy way of modeling complex hierarchical structures. Several advanced features are implemented including robust standard errors for clustered correlated data, multigroup analyses, non-linear parameter constraints, inference with incomplete data, maximum likelihood estimation with censored and binary observations, and instrumental variable estimators. In addition an extensive simulation interface covering a broad range of non-linear generalized structural equation models is described. The model and software are demonstrated in data of measurements of the serotonin transporter in the human brain.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16

Notes

  1. 1.

    For the lava.tobit package the weight argument is already reserved and the weight2 argument should be used instead and further the estimator should not be changed from the default.

  2. 2.

    For more information on mathematical annotation in R we refer to the plotmath help-page.

References

  1. Andersen EB (1971) The asymptotic distribution of conditional likelihood ratio tests. J Am Stat Assoc 66(335):630–633

    MATH  Article  Google Scholar 

  2. Angrist J (2001) Estimation of limited dependent variable models with dummy endogenous regressors: simple strategies for empirical practice. J Bus Econ Stat 19:2–16

    MathSciNet  Article  Google Scholar 

  3. Bates D, Maechler M (2009) lme4: linear mixed-effects models using S4 classes. http://CRAN.R-project.org/package=lme4, R package version 0.999375-31

  4. Boker S, Neale M, Maes H, Wilde M, Spiegel M, Brick T, Spies J, Estabrook R, Kenny S, Bates T, Mehta P, Fox J (2011) Openmx: an open source extended structural equation modeling framework. Psychometrika 76:306–317

    MathSciNet  MATH  Article  Google Scholar 

  5. Bollen K (1996) An alternative two stage least squares (2sls) estimator for latent variable equations. Psychometrika 61(1):109–121

    MathSciNet  MATH  Article  Google Scholar 

  6. Bollen KA (1989) Structural equations with latent variables. Applied probability and statistics, Wiley series in probability and mathematical statistics. Wiley, New York

  7. Bollen KA (2001) Two-stage least squares and latent variable models: simultaneous estimation and robustness to misspecification. In: Cudeck R, Sörbom D, Du Toit SHC (eds) Structural equation modeling, present and future: a festschrift in honor of Karl Jöreskog, Scientific Software International, Lincolnwood

  8. Bollen KA, Kirby JB, Curran PJ, Paxton PM, Chen F (2007) Latent variable models under misspecification two-stage least squares (2SLS) and maximum likelihood (ML) estimators. Soc Methods Res 36(1):48–86. doi:10.1177/0049124107301947

    MathSciNet  Article  Google Scholar 

  9. Budtz-Jørgensen E, Keiding N, Grandjean P, Weihe P, White RF (2003) Statistical methods for the evaluation of health effects of prenatal mercury exposure. Environmetrics 14:105–120

    Article  Google Scholar 

  10. Caffo B, Griswold M (2006) A user-friendly introduction to link-probit-normal models. Am Stat 60(2): 139–145

    MathSciNet  Article  Google Scholar 

  11. Csardi G, Nepusz T (2006) The igraph software package for complex network research, InterJ, Complex Syst 1695. http://igraph.sf.net

  12. Ditlevsen S, Christensen U, Lynch J, Damsgaard MT, Keiding N (2005) The mediation proportion: a structural equation approach for estimating the proportion of exposure effect on outcome explained by an intermediate variable. Epidemiology 16(1):114–120. doi:10.1097/01.ede.0000147107.76079.07

    Google Scholar 

  13. Erritzoe D, Holst KK, Frokjaer VG, Licht CL, Kalbitzer J, Nielsen FA, Svarer C, Madsen J, Knudsen GM (2010) A nonlinear relationship between cerebral serotonin transporter and 5-HT2A receptor binding: an in vivo molecular imaging study in humans. J Neurosci 30(9):3391–3397. doi:10.1523/JNEUROSCI.2852-09.2010. http://www.jneurosci.org/cgi/reprint/30/9/3391.pdf

    Google Scholar 

  14. Fox J (2006) Teacher’s corner: structural equation modeling with the sem package in r. Struct Equ Model Multidiscip J 13(13):465–585. doi:10.1207/s15328007sem1303_7

    Article  Google Scholar 

  15. Fox J (2009) Sem: structural equation models. http://CRAN.R-project.org/package=sem, R package version 0.9-16

  16. Gansner ER, North SC (1999) An open graph visualization system and its applications to software engineering. Softw Pract Exper 30:1203–1233

    Article  Google Scholar 

  17. Gentleman RC, Carey VJ, Bates DM et al (2004) Bioconductor: open software development for computational biology and bioinformatics. Genome Biol 5:R80. http://genomebiology.com/2004/5/10/R80

  18. Gentry J, Long L, Gentleman R, Falcon S, Hahne F, Sarkar D (2009) Rgraphviz: provides plotting capabilities for R graph objects. R package version 1.20.3

  19. Genz A, Bretz F, Miwa T, Mi X, Leisch F, Scheipl F, Hothorn T (2009) Mvtnorm: multivariate normal and t distributions. http://CRAN.R-project.org/package=mvtnorm, R package version 0.9-4

  20. Gilbert P (2009) NumDeriv: accurate numerical derivatives. http://www.bank-banque-canada.ca/pgilbert, R package version 2006.4-1

  21. Greene WH (2002) Econometric analysis, 5th edn. Prentice Hall, Englewood Cliffs

    Google Scholar 

  22. Holm S (1979) A simple sequentially rejective multiple test procedure. Scand J Stat 6(2):65–70. doi:10.2307/4615733

    MathSciNet  MATH  Google Scholar 

  23. Holst KK (2011) Lava.tobit: latent variable models with censored and binary outcomes. http://lava.r-forge.r-project.org, R package version 0.4-3

  24. Holst KK (2012) Gof: model-diagnostics based on cumulative residuals. http://CRAN.R-project.org/package=gof, R package version 0.8-1

  25. Horvitz DG, Thompson DJ (1952) A generalization of sampling without replacement from a finite universe. J Am Stat Assoc 47(260):663–685

    MathSciNet  MATH  Article  Google Scholar 

  26. Hotelling H (1953) New light on the correlation coefficient and its transforms. J R Stat Soc Ser B 15:193–225 (discussion, 225–232)

    Google Scholar 

  27. Jöreskog K (1970) A general method for analysis of covariance structures. Biometrika 57:239–251

    MathSciNet  MATH  Google Scholar 

  28. Kalbitzer J, Erritzoe D, Holst KK, Nielsen F, Marner L, Lehel S, Arentzen T, Jernigan TL, Knudsen GM (2010) Seasonal changes in brain serotonin transporter binding in short serotonin transporter linked polymorphic region-allele carriers but not in long-allele homozygotes. Biol Psychiatry 67:1033–1039. doi:10.1016/j.biopsych.2009.11.027

    Article  Google Scholar 

  29. Kenward MG, Molenberghs G (1998) Likelihood based frequentist inference when data are missing at random. Stat Sci 13(3):236–247. doi:10.1214/ss/1028905886

    MathSciNet  MATH  Article  Google Scholar 

  30. Laird NM, Ware JH (1982) Random-effects models for longitudinal data. Biometrics 38:963–974

    MATH  Article  Google Scholar 

  31. Lehmann EL, Romano JP (2005) Testing statistical hypotheses. Springer texts in statistics. Springer, New York

    Google Scholar 

  32. Liang KY, Zeger S (1986) Longitudinal data analysis using generalized linear models. Biometrika 73(1):13–22

    MathSciNet  MATH  Article  Google Scholar 

  33. Little RJA, Rubin DB (2002) Statistical analysis with missing data, 2nd edn. Wiley series in probability and statistics, Wiley, Hoboken

  34. Magnus JR, Neudecker H (1988) Matrix differential calculus with applications in statistics and econometrics. Wiley series in probability and mathematical statistics: Applied probability and statistics. Wiley, Chichester

  35. McArdle JJ, McDonald RP (1984) Some algebraic properties of the reticular action model for moment structures. Br J Math Stat Psychol 37(2):234–251

    MATH  Article  Google Scholar 

  36. Muthén LK, Muthén BO (2007) Mplus user’s guide (version 5), 5th edn. Muthén& Muthén, Los Angeles

  37. Paik M (1988) Repeated measurement analysis for nonnormal data in small samples. Commun Stat Simul Comput 17:1155–1171

    MATH  Article  Google Scholar 

  38. Pinheiro JC, Bates DM (2000) Mixed-effects models in S and S-PLUS. Springer, Berlin

    Google Scholar 

  39. Pinheiro JC, Chao EC (2006) Efficient laplacian and adaptive gaussian quadrature algorithms for multilevel generalized linear mixed models. J Comput Graph Stat 15(1):58–81

    MathSciNet  Article  Google Scholar 

  40. R Development Core Team (2010) R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna. http://www.R-project.org, ISBN 3-900051-07-0

  41. REvolution Computing (2009) Foreach: foreach looping construct for R. http://CRAN.R-project.org/package=foreach, R package version 1.3.0

  42. Rabe-Hesketh S, Skrondal A, Pickles A (2004) Generalized multilevel structural equation modeling. Psychometrika 69:167–190. doi:10.1007/BF02295939

    Google Scholar 

  43. Raftery A (1993) Bayesian model selection in structural equation models. In: Bollen K, Long J (eds) Testing structural equation models. Sage, Newbury Park, pp 163–180

    Google Scholar 

  44. Rotnitzky A, Robins JM (1995) Semiparametric regression estimation in the presence of dependent censoring. Biometrika 82(4):805–820

    MathSciNet  MATH  Article  Google Scholar 

  45. Sanchez BN, Budtz-Jørgensen E, Ryan LM, Hu H (2005) Structural equation models: a review with applications to environmental epidemiology. J Am Stat Assoc 100:1443–1455

    MATH  Article  Google Scholar 

  46. Sharpsteen C, Bracken C (2010) TikzDevice: a device for R graphics output in PGF/TikZ format. http://R-Forge.R-project.org/projects/tikzdevice, R package version 0.5.2/r34

  47. Steiger JH (2001) Driving fast in reverse. J Am Stat Assoc 96(453):331–338. doi:10.1198/016214501750332893

    Article  Google Scholar 

  48. Therneau T, original R port by Thomas Lumley (2009) Survival: survival analysis, including penalised likelihood. http://CRAN.R-project.org/package=survival, R package version 2.35-8

  49. White H (1982) Maximum likelihood estimation of misspecified models. Econometrica 50(1):1–26

    MathSciNet  MATH  Article  Google Scholar 

  50. Williams RL (2000) A note on robust variance estimation for cluster-correlated data. Biometrics 56(2):645–646. doi:10.1111/j.0006-341X.2000.00645.x

    MATH  Article  Google Scholar 

  51. Yan J, Fine J (2004) Estimating equations for association structures. Stat Med 23:859–874. doi:10.1002/sim.1650

    Article  Google Scholar 

Download references

Acknowledgments

We thank the referees for helpful comments. This work was supported by The Danish Agency for Science, Technology and Innovation.

Author information

Affiliations

Authors

Corresponding author

Correspondence to Klaus Kähler Holst.

Appendices

Appendix A: Some zero-one matrices

In this section we will define a few matrix-operators in order to define various conditional moments. Let \(\varvec{B}\in \mathbb R ^{n\times m}\) be a matrix, and define the indices \(\varvec{x} = \{x_{1},\ldots ,x_{k}\}\in \{1,\ldots ,n\}\), and \(\varvec{y} = \{y_{1},\ldots ,y_{l}\}\in \{1,\ldots ,m\}\). We define \(\varvec{J}_{n,\varvec{x}} = \varvec{J}_{\varvec{x}} \in \mathbb R ^{(n-k)\times n}\) as the \(n\times n\) identify matrix with rows \({\varvec{x}}\) removed. E.g.

$$\begin{aligned} {\varvec{J}}_{6,(3,4)} = \left(\begin{array}{l@{\quad }l@{\quad }l@{\quad }l@{\quad }l@{\quad }l} 1&0&0&0&0&0 \\ 0&1&0&0&0&0 \\ 0&0&0&0&1&0 \\ 0&0&0&0&0&1 \\ \end{array}\right). \end{aligned}$$

To remove rows \(\varvec{x}\) from \(\varvec{B}\) we simply multiply from the left with \(\varvec{J}_{n,\varvec{x}}\). If we in addition want to remove columns \(\varvec{y}\) we multiply with the transpose of \(\varvec{J}_{n,\varvec{y}}\) from the right:

$$\begin{aligned} \varvec{J}_{n,\varvec{x}}\varvec{B}\varvec{J}_{n,\varvec{y}}^{\prime }. \end{aligned}$$
(85)

We will use the notation \(\varvec{J}\) to denote the matrix that removes all latent variables (\(\varvec{\eta }\)) from the vector of all variable, \(\varvec{U}\) as defined in (8). We denote \(\varvec{J}_{\varvec{Y}}\) the matrix that only keeps endogenous variables (\(\varvec{Y}\)).

We also need an operator that cancels out rows or columns of a matrix/vector. Define the square matrix \(\varvec{p}_{n,\varvec{x}}\in \mathbb R ^{n\times n}\) as the identity-matrix with diagonal elements at position \(\varvec{x}\) canceled out:

$$\begin{aligned} \varvec{p}_{n,\varvec{x}}(i,j) = {\left\{ \begin{array}{ll} 1,&i=j, \ i\not \in \varvec{x}, \\ 0,&\text{ otherwise}. \end{array}\right.} \end{aligned}$$
(86)

e.g.

$$\begin{aligned} \varvec{p}_{6,(3,4)} = \left(\begin{array}{l@{\quad }l@{\quad }l@{\quad }l@{\quad }l@{\quad }l} 1&0&0&0&0&0 \\ 0&1&0&0&0&0 \\ 0&0&0&0&0&0 \\ 0&0&0&0&0&0 \\ 0&0&0&0&1&0 \\ 0&0&0&0&0&1 \\ \end{array}\right). \end{aligned}$$

To cancel out rows \(\varvec{x}\) and columns \(\varvec{y}\) of the matrix \(\varvec{B}\in \mathbb R ^{n\times m}\) we calculate

$$\begin{aligned} \varvec{p}_{n,\varvec{x}}\varvec{B}\varvec{p}_{m,\varvec{y}}^{\prime }. \end{aligned}$$

We will use \(\varvec{p}_{\varvec{X}}\) and \(\varvec{p}_{\complement \varvec{X}}\) as the matrix that cancels out the rows corresponding to the index of the exogenous variables (\(\varvec{X}\)) respectively the matrix that cancels out all rows but the ones corresponding to \(\varvec{X}\).

Appendix B: The score function and information

In this section we will calculate the analytical derivatives of the log-likelihood. In order to obtain these results we will first introduce the notation of some common matrix operations. Let \(\varvec{A}\in \mathbb R ^{m\times n}\), then we define the column-stacking operation:

$$\begin{aligned} \,\text{ vec}\,(\varvec{A}) = \begin{pmatrix} a_1 \\ \vdots \\ a_n \end{pmatrix}, \end{aligned}$$

where \(a_i\) denotes the ith column of \(\varvec{A}\). The unique commutation matrix, \(\mathbb R ^{mn\times mn}\) is defined by

$$\begin{aligned} \varvec{K}^{(m,n)}\,\text{ vec}\,(\varvec{A}) = \,\text{ vec}\,(\varvec{A}^{\prime }). \end{aligned}$$
(87)

Letting \(\varvec{H}^{(i,j)}\) be the \(m\times n\)-matrix with one at position \((i,j)\) and zero elsewhere, then

$$\begin{aligned} \varvec{K}^{(m,n)} = \sum _{i=1}^m\sum _{j=1}^n (\varvec{H}^{(i,j)}\otimes \varvec{H}^{(i,j)}{}^{\prime }), \end{aligned}$$

e.g.

It should be noted that product with a commutation matrix can be implemented very efficiently instead of relying on a direct implementation of the above mathematical definition.

Let \(\varvec{A}\in \mathbb R ^{m\times n}\) and \(\varvec{B}\in \mathbb R ^{p\times q}\) then the Kronecker product is the \(mp\times nq\)-matrix:

$$\begin{aligned} \varvec{A}\otimes \varvec{B} = \begin{pmatrix} a_{11}\varvec{B}&\cdots&a_{1n}\varvec{B} \\ \vdots&\vdots \\ a_{m1}\varvec{B}&\cdots&a_{mn}\varvec{B} \\ \end{pmatrix} \end{aligned}$$

We will calculate the derivatives of (20) by means of matrix differential calculus. The Jacobian matrix of a matrix-function \(F:\mathbb R ^n\rightarrow \mathbb R ^{m\times p}\) is the \(mp\times n\) matrix defined by

$$\begin{aligned} DF(\varvec{\theta }) = \frac{\partial \,\text{ vec}\,F(\varvec{\theta })}{\partial \varvec{\theta }^{\prime }}. \end{aligned}$$

Letting \(\,\text{ d}\!\,\) denote the differential operator (see Magnus and Neudecker 1988), the first identification rule states that \(\,\text{ d}\!\,\,\text{ vec}\,F(\varvec{\theta }) = A(\varvec{\theta })\,\text{ d}\!\,\varvec{\theta } \Rightarrow DF(\varvec{\theta }) = A(\varvec{\theta })\).

Appendix 14.1: Score function

Using the identities \(\,\text{ d}\!\,\log \left|\varvec{X}\right| = \,\text{ tr}\,(\varvec{X}^{-1}\,\text{ d}\!\,\varvec{X})\) and \(\,\text{ d}\!\,\varvec{X}^{-1} = -\varvec{X}^{-1}(\,\text{ d}\!\,\varvec{X})\varvec{X}^{-1}\), and applying the product rule we get

$$\begin{aligned} \,\text{ d}\!\,\ell (\varvec{\theta })&= -\frac{n}{2}\,\text{ tr}\,({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}) - \frac{n}{2}\,\text{ tr}\,(\,\text{ d}\!\,\{\widehat{\varvec{\varSigma }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\}) \end{aligned}$$
(88)
$$\begin{aligned}&= - \frac{n}{2}\,\text{ tr}\,({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}) + \frac{n}{2}\,\text{ tr}\,(\widehat{\varvec{\varSigma }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}[\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}]{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}), \end{aligned}$$
(89)

where

$$\begin{aligned} \,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}&= \left\{ \,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}\right\} {\varvec{P}}_{\varvec{\theta }}{\varvec{G}}_{\varvec{\theta }}^{\prime } + {\varvec{G}}_{\varvec{\theta }}\left\{ \,\text{ d}\!\,{\varvec{P}}_{\varvec{\theta }}{\varvec{G}}_{\varvec{\theta }}^{\prime }\right\} \end{aligned}$$
(90)
$$\begin{aligned}&= \left\{ \,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}\right\} {\varvec{P}}_{\varvec{\theta }}{\varvec{G}}_{\varvec{\theta }}^{\prime } + {\varvec{G}}_{\varvec{\theta }}\left\{ \,\text{ d}\!\,{\varvec{P}}_{\varvec{\theta }}\right\} {\varvec{G}}_{\varvec{\theta }}^{\prime } + {\varvec{G}}_{\varvec{\theta }}{\varvec{P}}_{\varvec{\theta }}\left\{ \,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}\right\} ^{\prime } \end{aligned}$$
(91)
$$\begin{aligned}&= \left\{ \,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}\right\} {\varvec{P}}_{\varvec{\theta }}{\varvec{G}}_{\varvec{\theta }}^{\prime } + [\left\{ \,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}\right\} {\varvec{P}}_{\varvec{\theta }}{\varvec{G}}_{\varvec{\theta }}^{\prime }]^{\prime } + {\varvec{G}}_{\varvec{\theta }}\left\{ \,\text{ d}\!\,{\varvec{P}}_{\varvec{\theta }}\right\} {\varvec{G}}_{\varvec{\theta }}^{\prime }, \end{aligned}$$
(92)

and

$$\begin{aligned} \,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}= \varvec{J}(\varvec{1}_m-{\varvec{A}}_{\varvec{\theta }})^{-1}\left\{ \,\text{ d}\!\,{\varvec{A}}_{\varvec{\theta }}\right\} (\varvec{1}_m-{\varvec{A}}_{\varvec{\theta }})^{-1}. \end{aligned}$$
(93)

Taking \(\,\text{ vec}\,\)’s it follows that

$$\begin{aligned} \,\text{ d}\!\,\,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}= \left[((\varvec{1}_m-{\varvec{A}}_{\varvec{\theta }})^{-1})^{\prime }\otimes {\varvec{G}}_{\varvec{\theta }}\right]\,\text{ d}\!\,\,\text{ vec}\,{\varvec{A}}_{\varvec{\theta }}\,\text{ d}\!\,\varvec{\theta }, \end{aligned}$$
(94)

hence by the first identification rule

$$\begin{aligned} \frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} = \left[((\varvec{1}_m-{\varvec{A}}_{\varvec{\theta }})^{-1})^{\prime }\otimes {\varvec{G}}_{\varvec{\theta }}\right] \frac{\partial \,\text{ vec}\,{\varvec{A}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}, \end{aligned}$$
(95)

and similarly

$$\begin{aligned} \frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} = (\varvec{1}_{k^2} + \varvec{K}^{(k,k)}) \left[{\varvec{G}}_{\varvec{\theta }}{\varvec{P}}_{\varvec{\theta }}\otimes \varvec{1}_k\right] \frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}+ \left[{\varvec{G}}_{\varvec{\theta }}\otimes {\varvec{G}}_{\varvec{\theta }}\right]\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }},\quad \end{aligned}$$
(96)

and finally (exploiting the symmetry of \({\varvec{\varOmega }}_{\varvec{\theta }}\) and commutative property under the trace operator) we obtain the gradient

$$\begin{aligned} \frac{\partial \ell (\varvec{\theta })}{\partial \varvec{\theta }} = \frac{n}{2}\left(\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right)^{\prime }\,\text{ vec}\,\left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\widehat{\varvec{\varSigma }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right] -\frac{n}{2}\left(\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right)^{\prime }\,\text{ vec}\,\left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right].\qquad \end{aligned}$$
(97)

Next we examine the model including a mean structure (20). W.r.t. to the first differential we observe that

$$\begin{aligned} \,\text{ d}\!\,\,\text{ tr}\,\left\{ {\varvec{T}}_{\varvec{\theta }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right\} = -\,\text{ tr}\,\left\{ {\varvec{T}}_{\varvec{\theta }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}(\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}){\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right\} + \,\text{ tr}\,\left\{ (\,\text{ d}\!\,{\varvec{T}}_{\varvec{\theta }}){\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right\} . \end{aligned}$$
(98)

Hence

$$\begin{aligned} \frac{\partial \ell (\varvec{\theta })}{\partial \varvec{\theta }}&= \frac{n}{2}\left(\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right)^{\prime }\,\text{ vec}\,\left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{T}}_{\varvec{\theta }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right] -\frac{n}{2}\left(\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right)^{\prime }\,\text{ vec}\,\left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right]\nonumber \\&\quad - \frac{n}{2}\left(\frac{\partial \,\text{ vec}\,{\varvec{T}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right)^{\prime }\,\text{ vec}\,\left({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right). \end{aligned}$$
(99)

Further by the chain-rule

$$\begin{aligned} \frac{\partial \,\text{ vec}\,{\varvec{T}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} = \frac{\partial (\widehat{\varvec{\mu }}-{\varvec{v}}_{\varvec{\theta }})}{\partial \varvec{\theta }^{\prime }} \frac{\partial \,\text{ vec}\,{\varvec{T}}_{\varvec{\theta }}}{\partial (\widehat{\varvec{\mu }}-{\varvec{\xi }}_{\varvec{\theta }})^{\prime }} = - \left[\varvec{1}_k\otimes (\widehat{\varvec{\mu }}-{\varvec{\xi }}_{\varvec{\theta }}) + (\widehat{\varvec{\mu }}-{\varvec{\xi }}_{\varvec{\theta }})\otimes \varvec{1}_k\right]\frac{\partial {\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }},\nonumber \\ \end{aligned}$$
(100)

and

$$\begin{aligned} \,\text{ d}\!\,{\varvec{\xi }}_{\varvec{\theta }} = (\,\text{ d}\!\,{\varvec{G}}_{\varvec{\theta }}){\varvec{v}}_{\varvec{\theta }} + {\varvec{G}}_{\varvec{\theta }}(\,\text{ d}\!\,{\varvec{v}}_{\varvec{\theta }}). \end{aligned}$$
(101)

Taking \(\,\text{ vec}\,\) (\({\varvec{G}}_{\varvec{\theta }}{\varvec{v}}_{\varvec{\theta }} = \varvec{1}{\varvec{G}}_{\varvec{\theta }}{\varvec{v}}_{\varvec{\theta }}\)):

$$\begin{aligned} \frac{\partial {\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} = ({\varvec{v}}_{\varvec{\theta }}^{\prime }\otimes \varvec{1}_k)\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} + {\varvec{G}}_{\varvec{\theta }}\frac{\partial {\varvec{v}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}. \end{aligned}$$
(102)

We have calculated the full score but in some situations it will be useful to evaluate the score in a single point. The contribution of a single observation to the log-likelihood is

$$\begin{aligned} \ell \le (\varvec{\theta }\mid \varvec{z}_i) \propto \frac{1}{2} \log \left|{\varvec{\varOmega }}_{\varvec{\theta }}\right| + \frac{1}{2}(\varvec{z}_i-{\varvec{\xi }}_{\varvec{\theta }})^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}(\varvec{z}_i-{\varvec{\xi }}_{\varvec{\theta }}), \end{aligned}$$
(103)

or as in (20) where we simply exchange \({\varvec{T}}_{\varvec{\theta }}\) with \(\varvec{T}_{\varvec{z}_i,\varvec{\theta }} = (\varvec{z}_i-{\varvec{\xi }}_{\varvec{\theta }})(\varvec{z}_i-{\varvec{\xi }}_{\varvec{\theta }})^{\prime }\), hence the score is as in (99) where (100) is calculated with \(\varvec{z}_i\) instead of \(\widehat{\varvec{\mu }}\). Alternatively, letting \(\varvec{z_i}-{\varvec{\xi }}_{\varvec{\theta }} = {\varvec{u}}_{\varvec{\theta }} = {\varvec{u}}_{\varvec{\theta }}(i)\):

$$\begin{aligned} \,\text{ d}\!\,({\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }})&= {\varvec{u}}_{\varvec{\theta }}^{\prime }\left[(2{\varvec{\varOmega }}_{\varvec{\theta }}^{-1})\,\text{ d}\!\,{\varvec{u}}_{\varvec{\theta }} + (\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}){\varvec{u}}_{\varvec{\theta }}\right] \nonumber \\&= - {\varvec{u}}_{\varvec{\theta }}^{\prime }\left[(2{\varvec{\varOmega }}_{\varvec{\theta }}^{-1})\,\text{ d}\!\,{\varvec{\xi }}_{\varvec{\theta }} + {\varvec{\varOmega }}_{\varvec{\theta }}^{-1}(\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}){\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}\right], \end{aligned}$$
(104)

where we used that for constant symmetric \(\varvec{A}\) the differential of a quadratic form is

$$\begin{aligned} \,\text{ d}\!\,(\varvec{u}^{\prime }\varvec{A}\varvec{u}) = 2\varvec{u}^{\prime }(\varvec{A})\,\text{ d}\!\,\varvec{u}. \end{aligned}$$
(105)

Hence the contribution to the score function of the \(i\)th observation is

$$\begin{aligned} \mathcal S _i(\varvec{\theta })&= -\frac{1}{2}\Big \{ \,\text{ vec}\,({\varvec{\varOmega }}_{\varvec{\theta }}^{-1})\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} -2{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\frac{\partial \,\text{ vec}\,{\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \nonumber \\&\quad - ({\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\otimes {\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1})\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \Big \} \nonumber \\&= -\frac{1}{2}\left\{ \left(\,\text{ vec}\,({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}) \!-\! \,\text{ vec}\,({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1})\right)\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \!-\!2{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\frac{\partial \,\text{ vec}\,{\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right\} ,\nonumber \\ \end{aligned}$$
(106)

where the score-function evaluated in \(\varvec{\theta }\) is \(\mathcal S (\varvec{\theta }) = \sum _{i=1}^n \mathcal S _i(\varvec{\theta })\).

The information matrix

The second order partial derivative is given by

$$\begin{aligned} \frac{\partial \ell (\varvec{\theta })}{\partial \theta _i\theta _j} \!=\! \!-\!\frac{1}{2}\frac{\partial }{\partial \theta _i}\left[\! \left\{ \,\text{ vec}\,\left({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right) \!-\! \,\text{ vec}\,\left({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right) \right\} \frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \theta _j} \!-\! 2{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\frac{\partial {\varvec{\xi }}_{\varvec{\theta }}}{\partial \theta _j} \!\right]\!.\nonumber \\ \end{aligned}$$
(107)

Taking negative expectation with respect to the true parameter \(\varvec{\theta }_0\) we obtain the expected information (Magnus and Neudecker 1988), which get rid of all second order derivatives

$$\begin{aligned} \mathcal I (\varvec{\theta }_0)&= \frac{1}{2}\left(\left. \frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right|_{\varvec{\theta }=\varvec{\theta }_0} \right)^{\prime }(\varvec{\varOmega }_{\varvec{\theta }_0}^{-1}\otimes \varvec{\varOmega }_{\varvec{\theta }_0}^{-1}) \left(\left. \frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right|_{\varvec{\theta }=\varvec{\theta }_0} \right) \end{aligned}$$
(108)
$$\begin{aligned}&\quad + \left(\left. \frac{\partial {\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right|_{\varvec{\theta }=\varvec{\theta }_0} \right)^{\prime } \varvec{\varOmega }_{\varvec{\theta }_0}^{-1} \left(\left. \frac{\partial {\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right|_{\varvec{\theta }=\varvec{\theta }_0} \right). \end{aligned}$$
(109)

We will further derive the observed information in the case where the second derivatives vanishes in the case of the matrix functions \({\varvec{A}}_{\varvec{\theta }}, {\varvec{P}}_{\varvec{\theta }}\) and \({\varvec{v}}_{\varvec{\theta }}\). Now

$$\begin{aligned} \,\text{ d}\!\,^2{\varvec{G}}_{\varvec{\theta }} = \,\text{ d}\!\,\left[\varvec{J}(\varvec{1}-{\varvec{A}}_{\varvec{\theta }})^{-1}(\,\text{ d}\!\,{\varvec{A}}_{\varvec{\theta }})(\varvec{1}-{\varvec{A}}_{\varvec{\theta }})^{-1}\right]. \end{aligned}$$
(110)

Hence

$$\begin{aligned} \frac{\partial ^2 {\varvec{G}}_{\varvec{\theta }}}{\partial \theta _i\partial \theta _j} = {\varvec{G}}_{\varvec{\theta }}\left[\frac{\partial {\varvec{A}}_{\varvec{\theta }}}{\partial \theta _i}(\varvec{1}-{\varvec{A}}_{\varvec{\theta }})^{-1}\frac{\partial {\varvec{A}}_{\varvec{\theta }}}{\partial \theta _j} + \frac{\partial {\varvec{A}}_{\varvec{\theta }}}{\partial \theta _j}(\varvec{1}-{\varvec{A}}_{\varvec{\theta }})^{-1}\frac{\partial {\varvec{A}}_{\varvec{\theta }}}{\partial \theta _i}\right](\varvec{1}-{\varvec{A}}_{\varvec{\theta }})^{-1}.\nonumber \\ \end{aligned}$$
(111)

Next we will find the derivative of (96). We let \(m\) denote the number of variables, \(p\) the number of parameters, and \(k\) the number of observed variable (e.g. \({\varvec{G}}_{\varvec{\theta }}\in \mathbb R ^{k\times m}\) and the number of columns in the derivatives are \(p\)). We have \({\varvec{G}}_{\varvec{\theta }}{\varvec{P}}_{\varvec{\theta }}\in \mathbb R ^{k\times m}\) and using rules for evaluating the differential of Kronecker-product (see Magnus and Neudecker 1988, pp. 184) we obtain

$$\begin{aligned} \frac{\partial \,\text{ vec}\,}{\partial \varvec{\theta }^{\prime }}( {\varvec{G}}_{\varvec{\theta }}{\varvec{P}}_{\varvec{\theta }}\otimes \varvec{1}_{k})&= \left(\varvec{1}_{m}\otimes \varvec{K}^{(k,k)}\otimes \varvec{1}_k\right) \left(\varvec{1}_{km}\otimes \,\text{ vec}\,\varvec{1}_k\right) \frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \nonumber \\&= \left(\varvec{1}_{m}\otimes \varvec{K}^{(k,k)}\otimes \varvec{1}_k\right)\left(\varvec{1}_{km} \otimes \,\text{ vec}\,\varvec{1}_k\right)\nonumber \\&\left[ ({\varvec{P}}_{\varvec{\theta }}\otimes \varvec{1}_k)\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} + (\varvec{1}_m\otimes {\varvec{G}}_{\varvec{\theta }})\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right]. \qquad \end{aligned}$$
(112)

And

$$\begin{aligned} \frac{\partial \,\text{ vec}\,}{\partial \varvec{\theta }}\left[({\varvec{G}}_{\varvec{\theta }}\otimes {\varvec{G}}_{\varvec{\theta }})\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right]&= \left[\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}^{\prime } \otimes \varvec{1}_{k^2}\right]\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}\otimes {\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \nonumber \\&= \left[\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}^{\prime }\otimes \varvec{1}_{k^2}\right] \left(\varvec{1}_m\otimes \varvec{K}^{(m,k)}\otimes \varvec{1}_k\right)\\&\times \left(\varvec{1}_{km}\otimes \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}+ \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}\otimes \varvec{1}_{km}\right) \frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}. \nonumber \end{aligned}$$
(113)

Hence from (112) and (113) and using rules for applying the \(\,\text{ vec}\,\) operator on products of matrices we obtain

$$\begin{aligned} \frac{\partial ^2\,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }\partial \varvec{\theta }^{\prime }}&= \left[\left(\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right)^{\prime }\otimes \left( \varvec{1}_{k^2}+\varvec{K}^{(k,k)} \right)\right] \left(\varvec{1}_{m}\otimes \varvec{K}^{k+k}\otimes \varvec{1}_k\right)\left(\varvec{1}_{km}\otimes \,\text{ vec}\,\varvec{1}_k\right) \nonumber \\&\times \left[({\varvec{P}}_{\varvec{\theta }}\otimes \varvec{1}_k)\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} + (\varvec{1}_m\otimes {\varvec{G}}_{\varvec{\theta }})\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right] \nonumber \\&+\Big (\varvec{1}_p \otimes ({\varvec{G}}_{\varvec{\theta }}{\varvec{P}}_{\varvec{\theta }}\otimes \varvec{1}_k)\Big ) \frac{\partial ^2\,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }\partial \varvec{\theta }^{\prime }} +\left(\left(\frac{\partial \,\text{ vec}\,{\varvec{P}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right)^{\prime }\otimes \varvec{1}_{k^2}\right) \nonumber \\&\times \left(\varvec{1}_m\otimes \varvec{K}^{(m,k)}\otimes \varvec{1}_k\right)\Big (\varvec{1}_{km}\otimes \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}+ \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}\otimes \varvec{1}_{km}\Big ) \frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }},\nonumber \\ \end{aligned}$$
(114)

with the expressions for the derivatives and second derivatives of \({\varvec{G}}_{\varvec{\theta }}\) given in (95) and (111). Further

$$\begin{aligned} \frac{\partial ^2{\varvec{\xi }}_{\varvec{\theta }}}{\partial {\varvec{\theta }}\partial \varvec{\theta }^{\prime }}&= \frac{\partial \,\text{ vec}\,}{\partial \varvec{\theta }^{\prime }}({\varvec{v}}_{\varvec{\theta }}^{\prime }\otimes \varvec{1}_k)\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} + \frac{\partial \,\text{ vec}\,}{\partial \varvec{\theta }^{\prime }}{\varvec{G}}_{\varvec{\theta }}\frac{\partial {\varvec{v}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\nonumber \\&= \left(\left(\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\right)^{\prime }\otimes \varvec{1}_k\right) \Big (\varvec{1}_m\otimes \,\text{ vec}\,\varvec{1}_k\Big )\frac{\partial \,\text{ vec}\,{\varvec{v}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\nonumber \\&+ (\varvec{1}_p\otimes ({\varvec{v}}_{\varvec{\theta }}^{\prime }\otimes \varvec{1}_k)) \frac{\partial ^2\,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }\partial \varvec{\theta }^{\prime }} \nonumber \\&+ \left(\frac{\partial \,\text{ vec}\,{\varvec{G}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \right)^{\prime }\frac{\partial {\varvec{v}}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}, \end{aligned}$$
(115)

and

$$\begin{aligned} \frac{\partial \,\text{ vec}\,}{\partial \varvec{\theta }^{\prime }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1} = -({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\otimes {\varvec{\varOmega }}_{\varvec{\theta }}^{-1})\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}, \end{aligned}$$
(116)

and

$$\begin{aligned} \,\text{ d}\!\,\left({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right)&= -{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}(\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}){\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}+ {\varvec{\varOmega }}_{\varvec{\theta }}^{-1}(\,\text{ d}\!\,{\varvec{u}}_{\varvec{\theta }}){\varvec{\mu }}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\end{aligned}$$
(117)
$$\begin{aligned}&+{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}(\,\text{ d}\!\,{\varvec{u}}_{\varvec{\theta }}^{\prime }){\varvec{\varOmega }}_{\varvec{\theta }}^{-1} - {\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}(\,\text{ d}\!\,{\varvec{\varOmega }}_{\varvec{\theta }}){\varvec{\varOmega }}_{\varvec{\theta }}^{-1}.\qquad \end{aligned}$$
(118)

By using the identity \(\,\text{ vec}\,(ABC) = (C^{\prime }\otimes A)\,\text{ vec}\,(B)\) several times we obtain

$$\begin{aligned} \frac{\partial \,\text{ vec}\,}{\partial \varvec{\theta }^{\prime }}{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }} {\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}&= -\left(\left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right]^{\prime }\otimes {\varvec{\varOmega }}_{\varvec{\theta }}^{-1} \right)\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}\end{aligned}$$
(119)
$$\begin{aligned}&- \left(\left[{\varvec{u}}_{\varvec{\theta }}^{\prime }{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right]^{\prime }\otimes {\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right) \frac{\partial \,\text{ vec}\,{\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \end{aligned}$$
(120)
$$\begin{aligned}&- \left({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\otimes \left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}\right]\right) \frac{\partial \,\text{ vec}\,{\varvec{\xi }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }} \end{aligned}$$
(121)
$$\begin{aligned}&- \left({\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\otimes \left[{\varvec{\varOmega }}_{\varvec{\theta }}^{-1}{\varvec{u}}_{\varvec{\theta }}{\varvec{u}}_{\varvec{\theta }}^{\prime } {\varvec{\varOmega }}_{\varvec{\theta }}^{-1}\right]\right)\frac{\partial \,\text{ vec}\,{\varvec{\varOmega }}_{\varvec{\theta }}}{\partial \varvec{\theta }^{\prime }}, \end{aligned}$$
(122)

and the second order derivative of the log-likelihood (107) now follows from applying the product rule with (114), (115), (116) and (119).

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Holst, K.K., Budtz-Jørgensen, E. Linear latent variable models: the lava-package. Comput Stat 28, 1385–1452 (2013). https://doi.org/10.1007/s00180-012-0344-y

Download citation

Keywords

  • Latent variable model
  • Structural equation model
  • R
  • Maximum likelihood
  • Serotonin
  • Seasonality
  • SERT