~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/plugins/distributions/plot_chi_squared_distribution.php

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2008-04-20 21:30:00 UTC
  • mfrom: (1.2.2 upstream) (3.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080420213000-fs4i8efmfc793bnn
new upstream release
closes: #475175
closes: #463348
closes: #475982

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?
2
 
        function preprocess () {
3
 
        }
4
 
        
5
 
        function calculate () {
6
 
        }
7
 
        
8
 
        function printout () {
9
 
?>rk.header ("Plot density <? getRK ("function"); ?>", list ("Number of Observations", "<? getRK ("n"); ?>", "Minimum", "<? getRK ("min"); ?>", "Maximum", "<? getRK ("max"); ?>", "Degrees of freedom", "<? getRK ("df"); ?>", "Function", "<? getRK ("function"); ?>"));
10
 
 
11
 
rk.graph.on ()
12
 
plot (<? getRK ("function"); ?> (seq(<? getRK ("min"); ?> ,<? getRK ("max"); ?>, length= <? getRK ("n"); ?>) , df = <? getRK ("df"); ?>), xlab=expression(chi^2))
13
 
rk.graph.off ()
14
 
<?
15
 
        }
16
 
        
17
 
        function cleanup () {
18
 
        }
 
2
include ("plot_dist_common.php");
 
3
 
 
4
function getParameters () {
 
5
        global $options;
 
6
 
 
7
        $options['df'] = getRK_val ("df");
 
8
        $options['ncp'] = getRK_val ("ncp");
 
9
        getContRangeParameters ();
 
10
 
 
11
        if ($options['is_density']) {
 
12
                $options['fun'] = "dchisq";
 
13
        } else {
 
14
                $options['fun'] = "pchisq";
 
15
        }
 
16
}
 
17
 
 
18
function doHeader () {
 
19
        global $options;
 
20
 
 
21
        echo ('rk.header ("Chisquare ' . $options['label'] . ' function", list ("Number of Observations", "' . $options['n'] . '", "Lower quantile", "' . $options['min'] . '", "Upper quantile", "' . $options['max'] . '", "Degrees of freedom", "' . $options['df'] . '", "Non-centrality parameter", "' . $options['ncp'] . '"' . $options['log_label'] . $options['tail_label'] . ', "Function", "' . $options['fun'] . '"));' . "\n");
 
22
}
 
23
 
 
24
function doFunCall () {
 
25
        global $options;
 
26
 
 
27
        echo ($options['fun'] . '(x, df=' . $options['df'] . ', ncp=' . $options['ncp'] . $options['log_option'] . $options['tail_option'] . ')');
 
28
}
19
29
?>