Пример #1
0
    $alg->register($test);
}
# Here we register the item selection criteria for the different tests
$alg = new OscatsAlgMaxFisher('OscatsAlgMaxFisher', array("A_opt" => True, "num" => 5));
$alg->register($tests[0]);
$alg = new OscatsAlgMaxFisher('OscatsAlgMaxFisher', array("num" => 5));
$alg->register($tests[1]);
$alg = new OscatsAlgMaxKl('OscatsAlgMaxKl', array("num" => 5));
$alg->register($tests[2]);
# In Example 1, we created OscatsExaminee objects for each examinee.
# Here, we'll just use one object over again for each administration.
$e = new OscatsExaminee('OscatsExaminee', array("covariates" => $covariate));
$sim_theta = new OscatsPoint('OscatsPoint', array("space" => $space));
$est_theta = new OscatsPoint('OscatsPoint', array("space" => $space));
$e->set_sim_theta($sim_theta);
$e->set_est_theta($est_theta);
print "Administering.\n";
for ($I = 0; $I < count($grid); $I++) {
    $sim_theta->set_cont($dims[0], $grid[$I]);
    for ($J = 0; $J < count($grid); $J++) {
        print sprintf("\rAt grid point (%g, %g) ...\n", $grid[$I], $grid[$J]);
        $sim_theta->set_cont($dims[1], $grid[$J]);
        for ($i = 0; $i < $N_EXAMINEES; $i++) {
            # "covariate" is the same OscatsCovariates object used by "e"
            $covariate->set_by_name($COVARIATE_NAME, Oscats::rnd_normal(1));
            print sprintf("\r%d", i);
            flush();
            for ($j = 0; $j < count($tests); $j++) {
                # Reset initial theta: Random start ~ N_2(0, I_2)
                $est_theta->set_cont($dims[0], Oscats::rnd_normal(1));
                $est_theta->set_cont($dims[1], Oscats::rnd_normal(1));