[rkward-cvs] SF.net SVN: rkward: [1599] trunk/rkward/rkward/plugins/distributions/clt
kapatp at users.sourceforge.net
kapatp at users.sourceforge.net
Fri Mar 16 07:31:05 UTC 2007
Revision: 1599
http://svn.sourceforge.net/rkward/?rev=1599&view=rev
Author: kapatp
Date: 2007-03-16 00:31:04 -0700 (Fri, 16 Mar 2007)
Log Message:
-----------
Remove list variables and use simple ones in binomial_clt
Modified Paths:
--------------
trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.php
trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.xml
Modified: trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.php 2007-03-16 07:01:59 UTC (rev 1598)
+++ trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.php 2007-03-16 07:31:04 UTC (rev 1599)
@@ -58,39 +58,38 @@
$yLim = ""; // initialise the ylim option
?>
-rk.temp.cltdistrib <- list()
# generate the entire data:
-rk.temp.cltdistrib$data <- matrix(rbinom(n=<? echo ($nAvg*$nDist); ?>, size = <? echo ($size); ?>, prob=<? echo ($prob); ?>), nrow=<? echo ($nAvg); ?>);
+data <- matrix(rbinom(n=<? echo ($nAvg*$nDist); ?>, size = <? echo ($size); ?>, prob=<? echo ($prob); ?>), nrow=<? echo ($nAvg); ?>);
# get the sample averages:
-rk.temp.cltdistrib$avg <- colMeans(rk.temp.cltdistrib$data);
+avg <- colMeans(data);
<?
if ($scalenorm) {
?>
# mean for the sample averages:
-rk.temp.cltdistrib$mean <- <? echo ($distExp); ?>;
+dist.mean <- <? echo ($distExp); ?>;
# variance for the sample averages:
-rk.temp.cltdistrib$var <- <? echo ($distVar); ?>;
+dist.var <- <? echo ($distVar); ?>;
# normalise the variables:
-rk.temp.cltdistrib$avg <- (rk.temp.cltdistrib$avg - rk.temp.cltdistrib$mean)/sqrt(rk.temp.cltdistrib$var);
+avg <- (avg - dist.mean)/sqrt(dist.var);
<?
}
if ($drawnorm) {
?>
# generate random normal samples:
-rk.temp.cltdistrib$normX <- seq(from=min(rk.temp.cltdistrib$avg), to=max(rk.temp.cltdistrib$avg), length=<? echo ($nDist); ?>);
-rk.temp.cltdistrib$normY <- <? echo ($normFun); ?> (rk.temp.cltdistrib$normX, mean = <? echo ($normMu); ?>, sd = <? echo ($normSigma); ?>);
+normX <- seq(from=min(avg), to=max(avg), length=<? echo ($nDist); ?>);
+normY <- <? echo ($normFun); ?> (normX, mean = <? echo ($normMu); ?>, sd = <? echo ($normSigma); ?>);
<?
}
if ($fun == "hist") {
?>
-rk.temp.cltdistrib$hist <- hist(rk.temp.cltdistrib$avg, plot=FALSE<? echo ($histcalcoptions); ?>);
+dist.hist <- hist(avg, plot=FALSE<? echo ($histcalcoptions); ?>);
<?
if ($drawnorm) {
?>
# calculate the ylims appropriately:
-rk.temp.cltdistrib$ylim <- c(0,max(c(rk.temp.cltdistrib$hist$density, rk.temp.cltdistrib$normY)));
+ylim <- c(0,max(c(dist.hist$density, normY)));
<?
- $yLim = ', ylim=rk.temp.cltdistrib$ylim';
+ $yLim = ', ylim=ylim';
}
}
if ($final) {
@@ -101,16 +100,16 @@
}
if ($fun == "hist") {
?>
- plot(rk.temp.cltdistrib$hist<? echo ($yLim); echo ($histplotoptions); ?>)
+ plot(dist.hist<? echo ($yLim); echo ($histplotoptions); ?>)
<?
} elseif ($fun == "dist") {
?>
- plot(ecdf(rk.temp.cltdistrib$avg)<? echo ($plotoptions); ?>)
+ plot(ecdf(avg)<? echo ($plotoptions); ?>)
<?
}
if ($drawnorm) {
?>
- lines (x=rk.temp.cltdistrib$normX, y=rk.temp.cltdistrib$normY, type="<? getRK ("normpointtype"); ?>"<? getRK ("normlinecol.code.printout"); ?>)
+ lines (x=normX, y=normY, type="<? getRK ("normpointtype"); ?>"<? getRK ("normlinecol.code.printout"); ?>)
<?
}
if ($final) {
Modified: trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.xml 2007-03-16 07:01:59 UTC (rev 1598)
+++ trunk/rkward/rkward/plugins/distributions/clt/plot_binomial_clt.xml 2007-03-16 07:31:04 UTC (rev 1599)
@@ -10,7 +10,7 @@
<set id="normlinecol.default_color" to="red" />
- <set id="histogram_opt.varname" to="rk.temp.cltdistrib$avg" />
+ <set id="histogram_opt.varname" to="avg" />
<set id="histogram_opt.allow_freq" to="false" />
<set id="histogram_opt.allow_barlabels" to="true" />
<set id="histogram_opt.allow_addtoplot" to="false" />
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