#include <swig_etirm.h>
Public Member Functions | |
SwigEtirmRun (int nitems, int nlatentcat, int ngroups, Real minTheta=-4.0, Real maxTheta=4.0, bool uniquePoints=false) | |
Class constructor. | |
virtual | ~SwigEtirmRun () |
Releases memory allocated by constructor. | |
void | CheckExaminees (const char *funcname) |
Checks that data for examinees exist. | |
void | CheckExamineeNumber (int examno, const char *funcname) |
Check that the examinee number is within its valid range. | |
void | CheckItemNumber (int itemno, const char *funcname) |
Checks for valid item number. | |
void | CheckGroup (int group, const char *funcname) |
Checks for valid group. | |
Public Attributes | |
ExamineeVector | examinees |
Vector holding pointers to examinee objects. | |
ItemVector | items |
Vector holding pointers to item objects. | |
ItemStatsVector | itemStats |
Vector holding pointers to item count objects. | |
UncminVector | minProc |
Vector holding pointers to minimization objects. | |
lvdist_type | latentDist |
Latent distribution object. | |
random_type * | rand_boot |
Base random number generator object for bootstrap. | |
random_type * | base_rand_simulate |
Base random number generator object for simulating item responses. | |
boost::uniform_01< random_type > * | rand_simulate |
Uniform random number generator object for simulating item responses. | |
std::string | returnString |
Temporary space to hold strings returned by functions. | |
int | numItems |
Number of operational/field test items to model. | |
int | numLatentCat |
Number of discrete categories to approximate the latent ability distribution. | |
int | numGroups |
Number of non-equivalents groups of examinees. | |
RealVector | examineeCounts |
Examinee counts in each group: examineeCounts[0] contains count across all groups; examineeCounts[i], i>0, contains count for group i. | |
double | mstepMaxDiff |
Maximum relative difference between item parameters computed in last M-Step call. |
Definition at line 158 of file swig_etirm.h.
etirm::SwigEtirmRun::SwigEtirmRun | ( | int | nitems, | |
int | nlatentcat, | |||
int | ngroups, | |||
Real | minTheta = -4.0 , |
|||
Real | maxTheta = 4.0 , |
|||
bool | uniquePoints = false | |||
) |
Class constructor.
[in] | nitems | Total number of items. |
[in] | nlatentcat | Number of categories of discrete latent variable. |
[in] | ngroups | Number of examinee groups. |
[in] | minTheta | Minimum value of theta points for discrete latent variable distribution. |
[in] | maxTheta | Maximum value of theta points for discrete latent variable distribution. |
[in] | uniquePoints | If true then unique latent distribution points are used for each examinee group. |
Definition at line 152 of file swig_etirm.cpp.
References etirm::DiscreteLatentDist< L >::begin_points(), etirm::DiscreteLatentDist< L >::begin_weights(), etirm::DiscreteNormalDist(), items, itemStats, latentDist, and minProc.
00153 : 00154 numItems(nitems), numLatentCat(nlatentcat), numGroups(ngroups), examineeCounts(ngroups+1, 0.0), 00155 items(nitems), itemStats(nitems), minProc(nitems), latentDist(nlatentcat, ngroups, 00156 uniquePoints), rand_boot(0), base_rand_simulate(0), rand_simulate(0) 00157 { 00158 int i; 00159 00160 // Set default points and weights for latent variable distribution to standard normal 00161 // for first group 00162 DiscreteNormalDist(nlatentcat, minTheta, maxTheta, latentDist.begin_points(1), 00163 latentDist.begin_weights(1)); 00164 00165 // Set points and weights for other groups equal to the points and weights for group 1 00166 for (i=2; i<=ngroups; ++i) 00167 { 00168 DiscreteLatentDist<Real>::weight_iterator w1 = latentDist.begin_weights(1); 00169 DiscreteLatentDist<Real>::weight_iterator w2 = latentDist.begin_weights(i); 00170 for (int j = nlatentcat; j--; ++w1, ++w2) 00171 { 00172 *w2 = *w1; 00173 } 00174 00175 if (uniquePoints) 00176 { 00177 // initialize unique points for examinee group 00178 DiscreteLatentDist<Real>::point_iterator w1p = latentDist.begin_points(1); 00179 DiscreteLatentDist<Real>::point_iterator w2p = latentDist.begin_points(i); 00180 for (int j = nlatentcat; j--; ++w1p, ++w2p) 00181 { 00182 *w2p = *w1p; 00183 } 00184 } 00185 } 00186 00187 /* initialize vectors of pointers to null */ 00188 for (i=0; i<nitems; ++i) 00189 { 00190 items[i] = 0; 00191 itemStats[i] = 0; 00192 minProc[i] = 0; 00193 } 00194 00195 }
etirm::SwigEtirmRun::~SwigEtirmRun | ( | ) | [virtual] |
Releases memory allocated by constructor.
Definition at line 198 of file swig_etirm.cpp.
References base_rand_simulate, examinees, items, itemStats, minProc, numItems, rand_boot, and rand_simulate.
00199 { 00200 int i; 00201 00202 for (i=0; i<numItems; i++) 00203 { 00204 if (items[i]) 00205 { 00206 items[i]->DeletePriors(); 00207 delete items[i]; 00208 } 00209 00210 if (itemStats[i]) 00211 delete itemStats[i]; 00212 if (minProc[i]) 00213 delete minProc[i]; 00214 } 00215 00216 int n = examinees.size(); 00217 for (i=0; i<n; ++i) 00218 { 00219 delete examinees[i]; 00220 } 00221 00222 delete rand_boot; 00223 delete base_rand_simulate; 00224 delete rand_simulate; 00225 }
void etirm::SwigEtirmRun::CheckExaminees | ( | const char * | funcname | ) |
Checks that data for examinees exist.
[in] | *funcname | Pointer to name of calling routine. |
Definition at line 228 of file swig_etirm.cpp.
References examinees, and etirm::gEtirmRun.
Referenced by etirm::bootstrap_sample(), and etirm::estep::compute().
00229 { 00230 if ((gEtirmRun->examinees).size() == 0) 00231 { 00232 throw RuntimeError("Error: No examinee data", funcname); 00233 } 00234 }
void etirm::SwigEtirmRun::CheckExamineeNumber | ( | int | examno, | |
const char * | funcname | |||
) |
Check that the examinee number is within its valid range.
[in] | examno | Examinee number. |
[in] | *funcname | Pointer to name of calling routine. |
Definition at line 237 of file swig_etirm.cpp.
References examinees, etirm::gEtirmRun, and returnString.
Referenced by etirm::examinee_get_count(), etirm::examinee_get_group(), etirm::examinee_get_posterior(), etirm::examinee_posterior_mean(), etirm::examinee_response_str(), etirm::examinee_responses(), etirm::examinee_set_count(), etirm::examinee_set_group(), etirm::examinee_set_posterior(), and etirm::examinee_theta_MLE().
00238 { 00239 if ( (examno < 1) || ( examno > (gEtirmRun->examinees).size() ) ) 00240 { 00241 char errstr[50]; 00242 std::sprintf(errstr, "Invalid examinee number: %d", examno); 00243 gEtirmRun->returnString = errstr; 00244 throw RuntimeError((gEtirmRun->returnString).c_str(), funcname); 00245 } 00246 }
void etirm::SwigEtirmRun::CheckItemNumber | ( | int | itemno, | |
const char * | funcname | |||
) |
Checks for valid item number.
[in] | itemno | Item number. |
[in] | *funcname | Pointer to name of calling routine. |
Definition at line 249 of file swig_etirm.cpp.
References etirm::gEtirmRun, numItems, and returnString.
Referenced by etirm::item_cat_counts(), etirm::item_get_all_params(), etirm::item_get_model(), etirm::item_get_param(), etirm::item_get_params(), etirm::item_get_prior_param(), etirm::item_get_prior_type(), etirm::item_num_params(), etirm::item_num_resp_cat(), etirm::item_prob_resp(), etirm::item_resp_count(), etirm::item_scale_params(), etirm::item_set_all_params(), etirm::item_set_param(), etirm::item_set_params(), etirm::item_set_prior(), etirm::mstep_max_iter(), and etirm::mstep_message().
00250 { 00251 if (itemno < 1 || itemno >(gEtirmRun->numItems) ) // Syntax edited, ww, 2-24-2008. 00252 { 00253 char errstr[50]; 00254 std::sprintf(errstr, "Invalid item number: %d", itemno); 00255 gEtirmRun->returnString = errstr; 00256 throw RuntimeError((gEtirmRun->returnString).c_str(), funcname); 00257 } 00258 }
void etirm::SwigEtirmRun::CheckGroup | ( | int | group, | |
const char * | funcname | |||
) |
Checks for valid group.
[in] | group | Group number. |
[in] | *funcname | Pointer to name of calling routine. |
Definition at line 263 of file swig_etirm.cpp.
References etirm::gEtirmRun, numGroups, and returnString.
Referenced by etirm::add_examinee(), etirm::dist_get_point(), etirm::dist_get_points(), etirm::dist_get_prob(), etirm::dist_get_probs(), etirm::dist_mean_sd(), etirm::dist_scale(), etirm::dist_set_point(), etirm::dist_set_points(), etirm::dist_set_prob(), etirm::dist_set_probs(), etirm::examinees_count(), etirm::item_cat_counts(), etirm::item_resp_count(), and etirm::mstep_dist().
00264 { 00265 if (group < 1 || group >(gEtirmRun->numGroups) ) // Syntax edited, ww, 2-24-2008 00266 { 00267 char errstr[50]; 00268 std::sprintf(errstr, "Invalid examinee group: %d", group); 00269 gEtirmRun->returnString = errstr; 00270 throw RuntimeError((gEtirmRun->returnString).c_str(), funcname); 00271 } 00272 }
Vector holding pointers to examinee objects.
Definition at line 169 of file swig_etirm.h.
Referenced by etirm::add_examinee(), etirm::bootstrap_sample(), CheckExamineeNumber(), CheckExaminees(), etirm::estep::compute(), etirm::examinee_get_count(), etirm::examinee_get_group(), etirm::examinee_get_posterior(), etirm::examinee_posterior_mean(), etirm::examinee_response_str(), etirm::examinee_responses(), etirm::examinee_set_count(), etirm::examinee_set_group(), etirm::examinee_set_posterior(), etirm::examinee_theta_MLE(), etirm::num_examinees(), and ~SwigEtirmRun().
Vector holding pointers to item objects.
Definition at line 172 of file swig_etirm.h.
Referenced by etirm::add_examinee(), etirm::estep::compute(), etirm::estep::estep(), etirm::examinee_response_str(), etirm::examinee_responses(), etirm::examinee_theta_MLE(), etirm::item_get_all_params(), etirm::item_get_model(), etirm::item_get_param(), etirm::item_get_params(), etirm::item_get_prior_param(), etirm::item_get_prior_type(), etirm::item_num_params(), etirm::item_num_resp_cat(), etirm::item_prob_resp(), etirm::item_scale_params(), etirm::item_set_all_params(), etirm::item_set_param(), etirm::item_set_params(), etirm::item_set_prior(), etirm::mstep_items(), etirm::simulate_responses(), SwigEtirmRun(), etirm::test_characteristic_curve(), and ~SwigEtirmRun().
Vector holding pointers to item count objects.
Definition at line 175 of file swig_etirm.h.
Referenced by etirm::add_examinee(), etirm::item_cat_counts(), etirm::item_resp_count(), SwigEtirmRun(), and ~SwigEtirmRun().
Vector holding pointers to minimization objects.
Definition at line 178 of file swig_etirm.h.
Referenced by etirm::mstep_items(), etirm::mstep_max_iter(), etirm::mstep_message(), SwigEtirmRun(), and ~SwigEtirmRun().
Latent distribution object.
Definition at line 181 of file swig_etirm.h.
Referenced by etirm::dist_get_point(), etirm::dist_get_points(), etirm::dist_get_prob(), etirm::dist_get_probs(), etirm::dist_mean_sd(), etirm::dist_scale(), etirm::dist_set_point(), etirm::dist_set_points(), etirm::dist_set_prob(), etirm::dist_set_probs(), etirm::dist_transform(), etirm::dist_unique_points(), etirm::estep::estep(), etirm::examinee_posterior_mean(), etirm::examinee_set_posterior(), etirm::mstep_dist(), and SwigEtirmRun().
Base random number generator object for bootstrap.
Definition at line 184 of file swig_etirm.h.
Referenced by etirm::bootstrap_sample(), etirm::bootstrap_seed(), and ~SwigEtirmRun().
Base random number generator object for simulating item responses.
Definition at line 187 of file swig_etirm.h.
Referenced by etirm::examinee_theta_MLE(), etirm::simulate_responses(), etirm::simulate_seed(), and ~SwigEtirmRun().
boost::uniform_01<random_type>* etirm::SwigEtirmRun::rand_simulate |
Uniform random number generator object for simulating item responses.
Definition at line 190 of file swig_etirm.h.
Referenced by etirm::examinee_theta_MLE(), etirm::simulate_responses(), etirm::simulate_seed(), and ~SwigEtirmRun().
std::string etirm::SwigEtirmRun::returnString |
Temporary space to hold strings returned by functions.
Definition at line 193 of file swig_etirm.h.
Referenced by CheckExamineeNumber(), CheckGroup(), CheckItemNumber(), etirm::CheckItemParam(), etirm::examinee_get_posterior(), etirm::examinee_posterior_mean(), etirm::examinee_response_str(), etirm::get_responses(), etirm::item_get_model(), etirm::item_get_prior_type(), etirm::item_set_all_params(), etirm::item_set_param(), and etirm::simulate_response_str().
Number of operational/field test items to model.
Definition at line 196 of file swig_etirm.h.
Referenced by etirm::add_examinee(), CheckItemNumber(), etirm::get_responses_missing(), etirm::num_items(), and ~SwigEtirmRun().
Number of discrete categories to approximate the latent ability distribution.
Definition at line 199 of file swig_etirm.h.
Referenced by etirm::examinee_set_posterior(), and etirm::num_latent_dist_points().
Number of non-equivalents groups of examinees.
Definition at line 202 of file swig_etirm.h.
Referenced by CheckGroup(), and etirm::num_groups().
Examinee counts in each group: examineeCounts[0] contains count across all groups; examineeCounts[i], i>0, contains count for group i.
Definition at line 205 of file swig_etirm.h.
Referenced by etirm::add_examinee(), etirm::bootstrap_sample(), and etirm::examinees_count().
Maximum relative difference between item parameters computed in last M-Step call.
Definition at line 208 of file swig_etirm.h.
Referenced by etirm::mstep_items(), and etirm::mstep_max_diff().