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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Jan 29 13:19:20 UTC 2007


Revision: 1237
          http://svn.sourceforge.net/rkward/?rev=1237&view=rev
Author:   tfry
Date:     2007-01-29 05:19:20 -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_f_distribution.php
    trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml

Modified: trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php	2007-01-29 13:15:40 UTC (rev 1236)
+++ trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php	2007-01-29 13:19:20 UTC (rev 1237)
@@ -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"); ?>", "Numerator degrees of freedom", "<? getRK ("df1"); ?>", "Denominator degrees of freedom", "<? getRK ("df2"); ?>", "Function", "<? getRK ("function"); ?>"));
 
+	$fun = getRK_val ("function");
+	if ($fun == "df") {
+		$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 ("F <? echo ($label); ?> function", list ("Number of Observations", "<? getRK ("n"); ?>", "Minimum", "<? getRK ("min"); ?>", "Maximum", "<? getRK ("max"); ?>", "Numerator degrees of freedom", "<? getRK ("df1"); ?>", "Denominator degrees of freedom", "<? getRK ("df2"); ?>", "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"); ?>) , df1 = <? getRK ("df1"); ?>, df2 = <? getRK ("df2"); ?>)))
+try (plot (function (x) <? getRK ("function"); ?> (x, df1 = <? getRK ("df1"); ?>, df2 = <? getRK ("df2"); ?>, 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_f_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml	2007-01-29 13:15:40 UTC (rev 1236)
+++ trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml	2007-01-29 13:19:20 UTC (rev 1237)
@@ -1,5 +1,5 @@
 <!DOCTYPE rkplugin>
-<document>
+<!--This is the simple "Plot F probabilities" plugin--><document>
 	<code file="plot_f_distribution.php" />
 	<dialog label="Plot F probabilities" >
 		<tabbook>
@@ -7,24 +7,31 @@
 				<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" >
-								<spinbox max_precision="6" default_precision="2" type="real" min="0.001" id="min" initial="0.001" label="Minimum" />
-								<spinbox max_precision="6" default_precision="2" type="real" min="0.001" id="max" initial="1999" label="Maximum" />
+								<spinbox max_precision="4" default_precision="2" type="real" min="0.001" id="min" initial="0.001" label="Minimum" />
+								<spinbox max_precision="4" default_precision="2" type="real" min="0.001" id="max" initial="25" label="Maximum" />
 							</frame>
 						</row>
-						<row>
-							<spinbox type="integer" min="1" id="df1" initial="1" label="Numerator degrees of freedom" />
-							<spinbox type="integer" min="1" id="df2" initial="1" label="Denominator degrees of freedom" />
-						</row>
+						<frame label="Parameters">
+							<row>
+								<spinbox max_precision="2" default_precision="2" type="real" min="0.01" id="df1" initial="5" label="Numerator degrees of freedom" />
+								<spinbox max_precision="2" default_precision="2" type="real" min="0.01" id="df2" initial="5" label="Denominator degrees of freedom" />
+							</row>
+							<row>
+								<spinbox max_precision="2" default_precision="0" type="real" min="0" id="ncp" initial="0" label="Non-centrality parameter" />
+							</row>
+						</frame>
 					</column>
 					<column>
 						<radio id="function" label="Choose type of function plot" >
 							<option value="df" label="Plot density function" />
 							<option value="pf" 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