Site Tools


notes:dan:contrast-matrix

This is an old revision of the document!


Contrast Matrix Formulation

The constraints on the full model can be written as $$\mathbf{L} ๐›ƒ = \mathbf{c} $$ Using Lagrange multiplier, we can get the estimate for null hypothesis $\widehat{๐›ƒ}_0$ by minimizing $$\mathcal{L}\equiv\left(\mathbf{y}-\mathbf{X}๐›ƒ\right)^{T}\left(\mathbf{y}-\mathbf{X}๐›ƒ\right)+\left(\mathbf{L}๐›ƒ-\mathbf{c}\right)^{T}๐›Œ,$$ where $๐›Œ$ is a column vector of multipliers. The minimization leads to $$ -2\mathbf{X}^{T}\left(\mathbf{y}-\mathbf{X}๐›ƒ_{0}\right)+\mathbf{L}^{T}๐›Œ_{0}=0 $$ and $$ \mathbf{L}๐›ƒ_{0}=\mathbf{c}. $$ These equations give \begin{align*} & \mathbf{L}^{T}๐›Œ_{0}=2\mathbf{X}^{T}\left(\mathbf{y}-\mathbf{X}๐›ƒ_{0}\right)=2\mathbf{X}^{T}\mathbf{y}-2\mathbf{X}^{T}\mathbf{X}๐›ƒ_{0}\\ \Rightarrow\, & \left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}๐›Œ_{0}=2\widehat{๐›ƒ}-2๐›ƒ_{0}\\ \Rightarrow\, & \mathbf{L}\left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}๐›Œ_{0}=2\mathbf{L}\widehat{๐›ƒ}-2\mathbf{c} \end{align*} or $$ ๐›Œ_{0}=2\left(\mathbf{L}\left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}\right)^{-1}\left(\mathbf{L}\widehat{๐›ƒ}-\mathbf{c}\right), $$ as well as $$ ๐›ƒ_{0}=\widehat{๐›ƒ}-\left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}๐›Œ_{0}/2, $$ or \begin{align*} \widehat{๐›ƒ}-๐›ƒ_{0} & = \left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}๐›Œ_{0}/2\\ & = \left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}\left(\mathbf{L}\left(\mathbf{X}^{T}\mathbf{X}\right)^{-1}\mathbf{L}^{T}\right)^{-1}\left(\mathbf{L}\widehat{๐›ƒ}-\mathbf{c}\right). \end{align*}

notes/dan/contrast-matrix.1647761366.txt.gz ยท Last modified: 2022/03/20 07:29 by cjj