[rkward-cvs] SF.net SVN: rkward: [1236] trunk/rkward/rkward/plugins/distributions

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Jan 29 13:15:40 UTC 2007


Revision: 1236
          http://svn.sourceforge.net/rkward/?rev=1236&view=rev
Author:   tfry
Date:     2007-01-29 05:15:40 -0800 (Mon, 29 Jan 2007)

Log Message:
-----------
Additional parameters, use plot.function to get better x axis labelling (Prasenjit Kapat)

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml
    trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.php
    trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.xml

Modified: trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml	2007-01-29 13:12:14 UTC (rev 1235)
+++ trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml	2007-01-29 13:15:40 UTC (rev 1236)
@@ -1,5 +1,5 @@
 <!DOCTYPE rkplugin>
-<document>
+<!--This is the simple "Plot gamma probabilities" plugin--><document>
 	<code file="plot_gamma_distribution.php" />
 	<dialog label="Plot gamma probabilities" >
 		<tabbook>

Modified: trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.php	2007-01-29 13:12:14 UTC (rev 1235)
+++ trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.php	2007-01-29 13:15:40 UTC (rev 1236)
@@ -1,19 +1,38 @@
 <?
 	function preprocess () {
 	}
-	
+
 	function calculate () {
 	}
-	
+
 	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"); ?>"));
 
+	$fun = getRK_val ("function");
+	if ($fun == "dnorm") {
+		$label = "density";
+		$lower_tag = "";
+		$tail_tag = "";
+	} else {
+		$label = "distribution";
+		if (getRK_val("lower") == "1") {
+			$lower_tag = ", lower.tail = 1";
+			$tail_tag = ", \"Tail\",\"Lower\"";
+		} else {
+			$lower_tag = ", lower.tail = 0";
+			$tail_tag = ", \"Tail\",\"Upper\"";
+		}
+	}
+	if (getRK_val ("log") == "1") $log_label="logarithmic";
+	else $log_label="normal";
+
+?>rk.header ("Normal <? echo ($label); ?> function", list ("Number of Observations", "<? getRK ("n"); ?>", "Minimum", "<? getRK ("min"); ?>", "Maximum", "<? getRK ("max"); ?>", "Mean", "<? getRK ("mean"); ?>", "Standard Deviation", "<? getRK ("sd"); ?>", "Non-centrality", "<? getRK ("ncp"); ?>", "Scaling", "<? echo ($log_label); ?>"<? echo ($tail_tag); ?>, "Function", "<? getRK ("function"); ?>"));
+
 rk.graph.on ()
-try (plot (<? getRK ("function"); ?> (seq(<? getRK ("min"); ?> ,<? getRK ("max"); ?>, length= <? getRK ("n"); ?>) , mean = <? getRK ("mean"); ?>, sd = <? getRK ("sd"); ?>)))
+try (plot (function (x) <? getRK ("function"); ?> (x, mean = <? getRK ("mean"); ?>, sd = <? getRK ("sd"); ?>, log = <? getRK ("log"); ?><? echo ($lower_tag); ?>), from=<? getRK ("min"); ?>, to=<? getRK ("max"); ?>, n=<? getRK ("n"); ?>))
 rk.graph.off ()
 <?
 	}
-	
+
 	function cleanup () {
 	}
 ?>

Modified: trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.xml	2007-01-29 13:12:14 UTC (rev 1235)
+++ trunk/rkward/rkward/plugins/distributions/plot_normal_distribution.xml	2007-01-29 13:15:40 UTC (rev 1236)
@@ -1,5 +1,5 @@
 <!DOCTYPE rkplugin>
-<document>
+<!--This is the simple "Plot normal probabilities" plugin--><document>
 	<code file="plot_normal_distribution.php" />
 	<dialog label="Plot normal probabilities" >
 		<tabbook>
@@ -11,13 +11,13 @@
 						</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" />
+								<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" />
+							<spinbox max_precision="2" default_precision="2" type="real" id="sd" min="0.01" initial="1" label="sigma (standard deviation)" label="standard deviation" />
 						</row>
 					</column>
 					<column>
@@ -25,6 +25,8 @@
 							<option value="dnorm" label="Plot density function" />
 							<option value="pnorm" label="Plot distribution" />
 						</radio>
+						<checkbox id="log" label="Logarithmic" value="1" value_unchecked="0"/>
+						<checkbox id="lower" label="Lower Tail" value="1" value_unchecked="0" checked="true"/>
 						<stretch/>
 					</column>
 				</row>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list