\name{TimelessNormalPM} \alias{TimelessNormalPM} \title{A multivariate normal proficiency model at a single time point } \description{ This class represents a proficiency model as a multivariate normal distribution. In particular, the latent variable is considered to be a multivariate normal variable. The parameter associated with this model is a \code{\link{TimelessNormalParam}}. The prior distributions of the two parameter components are independent: the mean vector has a normal prior and the covariance matrix has an inverse Wishert prior. } \usage{ TimelessNormalPM(...) } \arguments{ \item{\dots}{ The hyperparameters of the normal model. See details. } } \details{ This is an extension of \code{ProficiencyModel} for cases where the latent variable follows a multivariate normal distribution. It is called \sQuote{Timeless} because it is at a single time point. The parameter is a \code{TimelessNormalParam}. The prior distribution for the parameters is \code{mu ~ dnorm(muMean,muStd)} and \code{Sigma ~ diwish(Smean,Sdf)}. The four hyperparameters should be specified in the \ldots argument to the constructor function: \describe{ \item{muMean}{Mean of prior distribution for mean vector.} \item{varWeight}{Scale factor for covariance matrix.} \item{precMean}{Mean matrix for precision (inverse covariance) matrix.} \item{Sdf}{Degrees of freedom for prior distribution for precision (inverse covariance) matrix.} } This class ignores \code{background} variables. } \value{ An object of class \code{TimelessNormalPM}. } \references{ The following link: \url{http://thaines.com/content/misc/gaussian_conjugate_prior_cheat_sheet.pdf} is helpful in explaining the parameterization and the optimization updating. } \author{Russell Almond} \seealso{ Methods: \code{\link{nlatent}}, \code{\link{drawPMParam}}, \code{\link{drawInitialLatent}}, \code{\link{lpriorLatent}}, \code{\link{lpriorParam}} Superclass: \code{\link{ProficiencyModel}} Subclasses: } \examples{ pm1 <- TimelessNormalPM(muMean=c(Mechanics=2,Fluency=2), varWeight=3, precScale=solve(matrix(c(.7,.3,.3,.7),2,2)), Sdf=3) stopifnot(nlatent(pm1)==2L) pm1.p1 <- drawPMParam(pm1) ## Construct an invalid param (singular covariance) to test error ## handling. pm.pX <- TimelessNormalParam(mu=c(0,0),Sigma=matrix(1,2,2)) lpriorPMParam(pm1,pm1.p1) stopifnot(!is.finite(lpriorPMParam(pm1,pm.pX))) # -Inf pm1.stud10 <- drawInitialLatent(pm1,10,param=pm1.p1) print("Next command should generate an error.") stopifnot(class(try(drawInitialLatent(pm1,10,param=pm.pX))) == "try-error") lpriorLatent(pm1,pm1.stud10,param=pm1.p1) stopifnot(!is.finite(lpriorLatent(pm1,pm1.stud10,param=pm.pX))) # -Inf ## Test again using internal parameter parameters(pm1) <- drawPMParam(pm1) pm1.stud5 <- drawInitialLatent(pm1,5) lpriorLatent(pm1,pm1.stud5) stud1k <- drawInitialLatent(pm1,1000,param=pm1.p1) ##MLE pparam1.mle <- optimalPMParams(pm1,stud1k,Bayes=FALSE)$param ##MAP pparam1.map <- optimalPMParams(pm1,stud1k,Bayes=TRUE)$param } \keyword{ class } \keyword{ distribution }