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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Jan 29 12:59:30 UTC 2007


Revision: 1234
          http://svn.sourceforge.net/rkward/?rev=1234&view=rev
Author:   tfry
Date:     2007-01-29 04:59:30 -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_t_distribution.php
    trunk/rkward/rkward/plugins/distributions/plot_t_distribution.xml

Modified: trunk/rkward/rkward/plugins/distributions/plot_t_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_t_distribution.php	2007-01-29 12:50:31 UTC (rev 1233)
+++ trunk/rkward/rkward/plugins/distributions/plot_t_distribution.php	2007-01-29 12:59:30 UTC (rev 1234)
@@ -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"); ?>", "Degrees of freedom", "<? getRK ("df"); ?>", "Function", "<? getRK ("function"); ?>"));
 
+	$fun = getRK_val ("function");
+	if ($fun == "dt") {
+		$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 ("t <? echo ($label); ?> function", list ("Number of Observations", "<? getRK ("n"); ?>", "Minimum", "<? getRK ("min"); ?>", "Maximum", "<? getRK ("max"); ?>", "Degrees of freedom", "<? getRK ("df"); ?>", "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"); ?>) , df = <? getRK ("df"); ?>)))
+try (plot (function (x) <? getRK ("function"); ?> (x, df = <? getRK ("df"); ?>, ncp = <? getRK ("ncp"); ?>, 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_t_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_t_distribution.xml	2007-01-29 12:50:31 UTC (rev 1233)
+++ trunk/rkward/rkward/plugins/distributions/plot_t_distribution.xml	2007-01-29 12:59:30 UTC (rev 1234)
@@ -1,4 +1,5 @@
 <!DOCTYPE rkplugin>
+<!--This is the simple "Plot t probabilities" plugin-->
 <document>
 	<code file="plot_t_distribution.php" />
 	<dialog label="Plot t probabilities" >
@@ -7,7 +8,7 @@
 				<row>
 					<column>
 						<row>
-							<spinbox max_precision="2" default_precision="2" type="real" id="n" initial="100" label="Number of Observations" />
+							<spinbox type="integer" id="n" initial="100" label="Number of Observations" />
 						</row>
 						<row>
 							<frame label="Range" >
@@ -16,7 +17,10 @@
 							</frame>
 						</row>
 						<row>
-							<spinbox max_precision="2" default_precision="2" type="real" id="df" initial="0.01" label="Degrees of freedom" />
+							<frame label="Parameters">
+								<spinbox max_precision="2" default_precision="2" type="real" id="df" min="0.01" initial="1" label="Degrees of freedom" />
+								<spinbox max_precision="2" default_precision="2" type="real" id="ncp" min="0" initial="0" label="Non-centrality parameters" />
+							</frame>
 						</row>
 					</column>
 					<column>
@@ -24,6 +28,8 @@
 							<option value="dt" label="Plot density function" />
 							<option value="pt" 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