[rkward-cvs] rkward/rkward/plugins/distributions plot_binomial_distribution.php, 1.2, 1.3 plot_binomial_distribution.xml, 1.3, 1.4

Thomas Friedrichsmeier tfry at users.sourceforge.net
Thu Sep 14 14:58:53 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/plugins/distributions
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28440/distributions

Modified Files:
	plot_binomial_distribution.php plot_binomial_distribution.xml 
Log Message:
Implemented plot binomial distribution

Index: plot_binomial_distribution.xml
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugins/distributions/plot_binomial_distribution.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** plot_binomial_distribution.xml	23 Apr 2006 13:36:15 -0000	1.3
--- plot_binomial_distribution.xml	14 Sep 2006 14:58:51 -0000	1.4
***************
*** 1,34 ****
  <!DOCTYPE rkplugin>
! <!--This is the simple "Plot normal probabilities" plugin--><document>
!   <code file="plot_binomial_distribution.php" />
!   <dialog label="Plot normal probabilities" >
!     <tabbook>
!       <tab label="Plot normal probabilities" >
!           <row>
!             <column>
!               <row>
!                 <spinbox max_precision="2" default_precision="2" type="real" id="n" initial="100" label="Number of Observations" />
!               </row>
!               <row>
!                 <frame label="Range" >
!                   <spinbox max_precision="2" default_precision="2" type="real" id="min" initial="-3.291" label="Minimum" />
!                   <spinbox max_precision="2" default_precision="2" type="real" id="max" initial="3.291" label="Maximum" />
!                 </frame>
!               </row>
!               <row>
!                 <spinbox max_precision="2" default_precision="2" type="real" id="mean" initial="0" label="mu (mean)" />
! 		<spinbox max_precision="2" default_precision="2" type="real" id="sd" initial="1" label="sigma (standard deviation)" label="standard deviation" />
!               </row>
!             </column>
!             <column>
!               <radio id="function" label="Choose type of function plot" >
!                 <option value="dnorm" label="Plot density function" />
! 		<option value="pnorm" label="Plot distribution" />
!               </radio>
! 			  <stretch/>
!             </column>
!           </row>
!       </tab>
!     </tabbook>
!   </dialog>
  </document>
--- 1,31 ----
  <!DOCTYPE rkplugin>
! <!--This is the simple "Plot binomial probabilities" plugin--><document>
! <code file="plot_binomial_distribution.php" />
! <dialog label="Plot binomial probabilities" >
! 	<tabbook>
! 	<tab label="Plot binomial probabilities" >
! 		<row>
! 			<column>
! 				<frame label="Quantiles">
! 					<spinbox  type="integer" id="min" initial="0" label="lowest quantile" />
! 					<spinbox  type="integer" id="space" initial="1" min="1" label="quantile spacing" />
! 					<spinbox  type="integer" id="nq" initial="100" min="1" label="number of quantiles" />
! 				</frame>
! 				<row>
! 					<spinbox type="integer" id="size" initial="100" min="0" label="Number of trials" />
! 					<spinbox max_precision="4" default_precision="2" type="real" id="prob" initial="0.5" min="0" max="1" label="Probability of success on each trial" />
! 				</row>
! 			</column>
! 			<column>
! 				<radio id="function" label="Choose type of function plot" >
! 					<option value="dbinom" label="Plot density function" />
! 					<option value="pbinom" label="Plot distribution" />
! 				</radio>
! 				<checkbox id="log" label="Logarithmic" value="1"/>
! 			<stretch/>
! 			</column>
! 		</row>
! 	</tab>
! 	</tabbook>
! </dialog>
  </document>

Index: plot_binomial_distribution.php
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugins/distributions/plot_binomial_distribution.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** plot_binomial_distribution.php	5 Apr 2006 10:10:03 -0000	1.2
--- plot_binomial_distribution.php	14 Sep 2006 14:58:51 -0000	1.3
***************
*** 7,14 ****
  	
  	function printout () {
! ?>rk.header ("Plot density <? getRK ("function"); ?>", list ("Number of Observations", "<? getRK ("n"); ?>", "Minimum", "<? getRK ("min"); ?>", "Maximum", "<? getRK ("max"); ?>", "Mean", "<? getRK ("mean"); ?>", "Standard Deviation", "<? getRK ("sd"); ?>", "Function", "<? getRK ("function"); ?>"));
  
  rk.graph.on ()
! plot (<? getRK ("function"); ?> (seq(<? getRK ("min"); ?> ,<? getRK ("max"); ?>, length= <? getRK ("n"); ?>) , mean = <? getRK ("mean"); ?>, sd = <? getRK ("sd"); ?>))
  rk.graph.off ()
  <?
--- 7,36 ----
  	
  	function printout () {
! 		$fun = getRK_val ("function");
! 		if ($fun == "dbinom") $label = "density";
! 		else $label = "distribution";
! 	
! 		$min = getRK_val ("min");
! 		$nq = getRK_val ("nq");
! 		$space = getRK_val ("space");
! 		$size = getRK_val ("size");
! 		$prob = getRK_val ("prob");
! 	
! 		if (getRK_val ("log") == "1") {
! 			if ($fun == "dbinom") {
! 				$log = ", log=TRUE";
! 			} else {
! 				$log = ", log.p=TRUE";
! 			}
! 			$log_label="logarithmic";
! 		} else {
! 			$log = "";
! 			$log_label="normal";
! 		}
! 
! ?>rk.header ("Plot binomial <? echo ($label); ?>", list ("Lowest quantile", "<? echo ($min); ?>", "Largest quantile", "<? echo ($min + ($nq * $space)); ?>", "Quantile spacing", "<? echo ($space); ?>", "Number of trials", "<? echo ($size); ?>", "Probability of success on each trial", "<? echo ($prob); ?>", "Function", "<? getRK ("function"); ?>", "Scaling", "<? echo ($log_label); ?>"));
  
  rk.graph.on ()
! plot (<? getRK ("function"); ?> (seq (<? echo ($min); ?>, <? echo ($min + ($nq * $space)); ?>, by=<? echo ($space); ?>) , size=<? echo ($size); ?>, prob=<? echo ($prob); echo ($log); ?>))
  rk.graph.off ()
  <?





More information about the rkward-tracker mailing list