~ubuntu-branches/ubuntu/karmic/rkward/karmic

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2006-11-06 16:30:00 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 feisty)
  • Revision ID: james.westby@ubuntu.com-20061106163000-qi8ju75eqecrfay7
* new upstream release
* depend on either php4-cli or php5-cli

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?
 
2
function preprocess () {
 
3
}
 
4
 
 
5
function calculate () {
 
6
        global $q;
 
7
        $q = "c (" . preg_replace ("/[, ]+/", ", ", getRK_val ("q")) . ")";
 
8
 
 
9
?>
 
10
rk.temp = (pnbinom (q = <? echo ($q); ?>, size = <? getRK ("size"); ?>, prob = <? getRK ("prob"); ?>, <? getRK ("tail"); ?>, <? getRK("logp"); ?>))
 
11
<?
 
12
}
 
13
 
 
14
function printout () {
 
15
        global $q;
 
16
?>
 
17
rk.header ("Negative Binomial probability", list ("Vector of quantiles", "<? echo ($q); ?>", "Size", "<? getRK ("size"); ?>", "Probability of success in each trial", "<? getRK ("prob"); ?>", "Tail", "<? getRK ("tail"); ?>", "Probabilities p are given as", "<? getRK ("logp"); ?>"))
 
18
cat ("<h3>Negative Binomial probabilities:  ", rk.temp, "</h3>")
 
19
<?
 
20
}
 
21
 
 
22
function cleanup () {
 
23
?>
 
24
rm (rk.temp)
 
25
<?
 
26
}
 
27
?>