Qmatrix
theta1 theta2
item1 1 0
item2 1 0
item3 1 0
item4 1 0
item5 1 0
item6 0 1
item7 0 1
item8 0 1
item9 0 1
item10 0 1
Today we will be using the simulated data we started class with and used in Lecture 7
Qmatrix
theta1 theta2
item1 1 0
item2 1 0
item3 1 0
item4 1 0
item5 1 0
item6 0 1
item7 0 1
item8 0 1
item9 0 1
item10 0 1
For our example, we will assume the set of traits follows a multivariate normal distribution
\[ f\left(\boldsymbol{\theta}_p \right) = \left(2 \pi \right)^{-\frac{D}{2}} \det\left(\boldsymbol{\Sigma}_\theta \right)^{-\frac{1}{2}}\exp\left[-\frac{1}{2}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right)^T\boldsymbol{\Sigma}_\theta^{-1}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right) \right] \] Where:
Alternatively, we would specify \(\boldsymbol{\theta}_p \sim N_D\left( \boldsymbol{\mu}_\theta, \boldsymbol{\Sigma}_\theta \right)\); but, we cannot always estimate \(\boldsymbol{\mu}_\theta\) and \(\boldsymbol{\Sigma}_\theta\)
For the IRT analyses, we will use a two parameter logistic item response model where:
\[ P\left(Y_{pi} = 1 \mid \theta \right) = \frac{\exp(\mu_{i}+ \sum_{d=1}^D q_{id}\lambda_{id}\theta_{pd})}{1+\exp(\mu_{i}+ \sum_{d=1}^D q_{id}\lambda_{id}\theta_{pd})}\]
For the CFA analyses, we will use a CFA model where:
\[ Y_{pi} = \mu_{i}+ \sum_{d=1}^D q_{id}\lambda_{id}\theta_{pd} + \epsilon_{pi}\]
Where:
Bayesian analyses can be implemented in many different software packages
From Stan’s Functions Reference, for a correlation matrix \(\textbf{R}_\theta\)
Correlation Matrix Properties:
LKJ Prior, with hyperparameter \(\eta\), is proportional to the determinant of the correlation matrix
\[\text{LKJ}\left(\textbf{R}_\theta \mid \eta \right) \propto \det\left(\textbf{R}_\theta \right)^{(\eta-1)} \] Where:
For this example, we set \(\eta=1\), noting a uniform prior over all correlation matrices
The functions we are using do not use the correlation matrix directly
\[\textbf{R}_\theta = \textbf{L}_\theta \textbf{L}_\theta^T\]
\[-\frac{1}{2}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right)^T\textbf{R}_\theta^{-1}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right) = -\frac{1}{2}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right)^T\left(\textbf{L}_\theta \textbf{L}_\theta^T\right)^{-1}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right) \]
\[ -\frac{1}{2}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right)^T\textbf{L}_\theta^{-T} \textbf{L}_\theta^{-1}\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right)\] Then, we solve by back substitution: \(\left(\boldsymbol{\theta}_p - \boldsymbol{\mu}_\theta \right)^T\textbf{L}_\theta^{-T}\)
Most algorithms using MVN distributions use some variant of this process (perhaps with a different factorization method such as QR)
I teach a Bayesian Psychometric Models course on occasion:
Much more detail in both courses about how Bayesian estimation works