~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/plugins/analysis/irt/dichotomous/par_est_3pl.php

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-05-11 21:58:23 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090511215823-m2f3gehcvapwrzgp
Tags: 0.5.0d-0ubuntu1
* New upstream release (LP: #375213)
* Bump Standards-Version to 3.8.1
* Drop cmake, libphon-dev from build-deps
* Update maintainer field

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?
 
2
function preprocess () {
 
3
  // we'll need the ltm package, so in case it's not loaded...
 
4
?>
 
5
  require(ltm)
 
6
<?}
 
7
 
 
8
function calculate () {
 
9
  // let's read all values into php variables for the sake of readable code
 
10
  $constraint   = getRK_val("constraint");
 
11
  $startval     = getRK_val("startval");
 
12
  $startval_mtx = getRK_val("startval_mtx");
 
13
  $naaction     = getRK_val("naaction");
 
14
  $irtparam     = getRK_val("irtparam");
 
15
  $optimeth     = getRK_val("optimeth");
 
16
  $verbose      = getRK_val("verbose");
 
17
  // these are 3pl specific
 
18
  $ghk_3pl      = getRK_val("ghk_3pl");
 
19
  $iterqn_3pl   = getRK_val("iterqn_3pl");
 
20
  $type         = getRK_val("type");
 
21
  $maxguess     = getRK_val("maxguess");
 
22
  $optimizer    = getRK_val("optimizer");
 
23
  $epshess      = getRK_val("epshess");
 
24
  // $parscale     = getRK_val("parscale"); not implemented yet...
 
25
 
 
26
  ///////////////////////////////////
 
27
  // check for selected advanced control options
 
28
  $control = array() ;
 
29
  if($optimizer != "optim")
 
30
    $control[] = "optimizer=\"nlminb\"" ;
 
31
  if($iterqn_3pl != "1000")
 
32
    $control[] = "iter.qN=".$iterqn_3pl ;
 
33
  if($ghk_3pl != "21")
 
34
    $control[] = "GHk=".$ghk_3pl ;
 
35
  if($optimizer == "optim" && $optimeth != "BFGS")
 
36
    $control[] = "method=\"".$optimeth."\"" ;
 
37
  if($verbose == "TRUE")
 
38
    $control[] = "verbose=TRUE" ;
 
39
  if($epshess != "1e-03")
 
40
    $control[] = "eps.hessian=".$epshess ;
 
41
 
 
42
?>estimates.3pl <<- tpm(<? getRK("x");
 
43
                  // any additional options?
 
44
                  if($type == "rasch") echo(", type=\"rasch\"");
 
45
                  if($constraint) echo(", constraint=".$constraint);
 
46
                  if($maxguess != "1") echo(", max.guessing=".$maxguess);
 
47
                  if($irtparam != "TRUE") echo(", IRT.param=FALSE");
 
48
                  if($startval == "random") echo(", start.val=\"random\"");
 
49
                  if($startval == "matrix") echo(", start.val=".$startval_mtx);
 
50
                  if($naaction) echo(", na.action=".$naaction);
 
51
                  // finally check if any advanced control options must be inserted
 
52
                  if($control) echo(", control=list(".join(", ", $control).")");
 
53
 ?>)
 
54
<?}
 
55
 
 
56
function printout () {
 
57
?>
 
58
rk.header ("3PL parameter estimation")
 
59
rk.print (estimates.3pl)
 
60
<?
 
61
}
 
62
?>
 
 
b'\\ No newline at end of file'