\name{compareAMD} \alias{compareAMD} \title{Compares two Assessment Model Description objects.} \description{ Tests two distributions to see if the parameters from \code{testAMD} are consistent with \code{postAMD}. Typically \code{testAMD} is the data generation parameters, and \code{postAMD} is the posterior distribution from calibration. In which case, this is a parameter recovery test. } \usage{ compareAMD(postAMD, testAMD, level = 0.05, chatty = TRUE) } \arguments{ \item{postAMD}{Assessment Model Description with the reference distribution. Both the values and standard errors of this parameter are used. Typically this is a posterior distribution from a calibration.} \item{testAMD}{A second amd whose values are to be tested. Typically this is the data generation AMD. } \item{level}{Level of the test (used for chatty reporting). Must be between 0 and 1.} \item{chatty}{If true, test results from each parameter are printed to standard output.} } \details{ Performs a parameter comparison on each model from both amds. If the AMDs have different models, or different variables, an error results. Each test is performed with \code{compareDS} or \code{compareHD} for DiBello--Samejima or hyper-Dirichelet distributions respectively. The results of each test is a chi-square value which is accumulated across all tests. If \code{chatty} is true, then the invidual test results are printed. } \value{ \item{chi2}{Total Chi-squared value.} \item{df}{Total degrees of freedom.} } \author{Russell Almond} \note{This is essentially the same as the StatShop theoretical parameter recovery test, and was in fact developed to test that code.} \seealso{\code{\link{compareDS}}, \code{\link{compareHD}}, \code{\link{parseAMD}}} \examples{ #Assumes StatShop is installed on the test machine. StatShop <- Sys.getenv("STATSHOP") if (StatShop == "") { warn("StatShop not installed, skipping test.") } else { estAMD <- parseAMD(paste(StatShop,"TestScripts","ICT","Version0", "Hybrid","EstimatedModel","EvalOnlyEst.amd.xml", sep=.Platform$file.sep)) genAMD <- parseAMD(paste(StatShop,"TestScripts","ICT","Version0", "Hybrid","RandomDraw1","HD3P4EvaluateDraw1.amd.xml", sep=.Platform$file.sep)) result <- compareAMD(estAMD,genAMD) print(result) print(pchisq(result$chi2,result$df)) } } \keyword{htest}