etirm::SwigEtirmRun Class Reference

Class holding information used for one modeling problem. More...

#include <swig_etirm.h>

Collaboration diagram for etirm::SwigEtirmRun:

Collaboration graph
[legend]

List of all members.

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_typerand_boot
 Base random number generator object for bootstrap.
random_typebase_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.


Detailed Description

Class holding information used for one modeling problem.

Definition at line 158 of file swig_etirm.h.


Constructor & Destructor Documentation

etirm::SwigEtirmRun::SwigEtirmRun ( int  nitems,
int  nlatentcat,
int  ngroups,
Real  minTheta = -4.0,
Real  maxTheta = 4.0,
bool  uniquePoints = false 
)

Class constructor.

Function Parameters

Parameters:
[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   }

Here is the call graph for this function:

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   }


Member Function Documentation

void etirm::SwigEtirmRun::CheckExaminees ( const char *  funcname  ) 

Checks that data for examinees exist.

Function Parameters

Parameters:
[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   }

Here is the caller graph for this function:

void etirm::SwigEtirmRun::CheckExamineeNumber ( int  examno,
const char *  funcname 
)

Check that the examinee number is within its valid range.

Function Parameters

Parameters:
[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   }

Here is the caller graph for this function:

void etirm::SwigEtirmRun::CheckItemNumber ( int  itemno,
const char *  funcname 
)

Checks for valid item number.

Function Parameters

Parameters:
[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   }

Here is the caller graph for this function:

void etirm::SwigEtirmRun::CheckGroup ( int  group,
const char *  funcname 
)

Checks for valid group.

Function Parameters

Parameters:
[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   }

Here is the caller graph for this function:


Member Data Documentation

ExamineeVector etirm::SwigEtirmRun::examinees

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().

ItemVector etirm::SwigEtirmRun::items

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().

ItemStatsVector etirm::SwigEtirmRun::itemStats

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().

UncminVector etirm::SwigEtirmRun::minProc

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().

lvdist_type etirm::SwigEtirmRun::latentDist

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().

random_type* etirm::SwigEtirmRun::rand_boot

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().

random_type* etirm::SwigEtirmRun::base_rand_simulate

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().

int etirm::SwigEtirmRun::numItems

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().

int etirm::SwigEtirmRun::numLatentCat

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().

int etirm::SwigEtirmRun::numGroups

Number of non-equivalents groups of examinees.

Definition at line 202 of file swig_etirm.h.

Referenced by CheckGroup(), and etirm::num_groups().

RealVector etirm::SwigEtirmRun::examineeCounts

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().

double etirm::SwigEtirmRun::mstepMaxDiff

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().


The documentation for this class was generated from the following files:
Generated on Sat Mar 1 21:42:01 2008 for ETIRM by  doxygen 1.5.4