TITLE: Figuring out the likelihood by hand NGroups 1 Calculation !Declare matrices here Begin Matrices; ! After MATRIX letter, specify type of matrix i.e. FULL or SYMMETRIC and matrix DIMENSIONS E ! Expected Covariance Matrix H ! T ! M ! Mean vector P ! Pi X ! Observed Data End Matrices; ! Declare matrix values here Matrix E !Place values for MATRIX E here Matrix H !Place values for MATRIX H here !Input other matrices and values here Begin Algebra; O= ! Fractional part: 2*pi*sqrt(det(e)) (5.4414) Q= ! Mahalanobis distance: (indiv score - mean)’ & inverse of covariance matrix (0.6533) R= ! e to the power -.5 * Mahalanobis distance (0.7213) S=-T*\ln(R%O); ! minus twice log-likelihood (4.0414) Z=-T*\ln(\pdfnor(X'_M'_E)); ! an easier way (4.0414) End Algebra; End Group;