2
function preprocess () {
5
function calculate () {
18
// get the range parameters for the continuous distributions (it's all the same for these)
19
function getContRangeParameters () {
22
$options['n'] = getRK_val ("n");
23
$options['min'] = getRK_val ("min");
24
$options['max'] = getRK_val ("max");
27
// get the range parameters for the discontinuous distributions (it's all the same for these)
28
function getDiscontRangeParameters () {
31
$options['min'] = getRK_val ("min");
32
$options['max'] = getRK_val ("max");
33
$options['n'] = $options['max'] - $options['min'] + 1;
36
function doPrintout ($final) {
39
$fun = getRK_val ("function");
40
$log = (getRK_val ("log") == 1);
47
if ($log) $log_option = ", log=TRUE";
50
$label = "distribution";
51
if (getRK_val("lower") == "1") {
52
$tail_option = ", lower.tail = TRUE";
53
$tail_label = ", \"Tail\",\"Lower\"";
55
$tail_option = ", lower.tail = FALSE";
56
$tail_label = ", \"Tail\",\"Upper\"";
58
if ($log) $log_option = ", log.p=TRUE";
60
if ($log) $log_label = ', "Scale", "logarithmic"';
61
else $log_label = ', "Scale", "normal"';
64
$options['is_density'] = $is_density;
65
$options['label'] = $label;
66
$options['tail_option'] = $tail_option;
67
$options['tail_label'] = $tail_label;
68
$options['log_option'] = $log_option;
69
$options['log_label'] = $log_label;
80
curve (<? doFunCall (); ?>, from=<? echo ($options['min']); ?>, to=<? echo ($options['max']); ?>, n=<? echo ($options['n']); ?><? getRK ("plotoptions.code.printout"); ?>)
82
$plot_adds = getRK_val ("plotoptions.code.calculate");
83
if (!empty ($plot_adds)) { ?>
86
printIndented ("\t", $plot_adds);