[Distr-commits] r388 - branches/distr-2.1/pkg/distrDoc/inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 29 13:59:21 CET 2009


Author: stamats
Date: 2009-01-29 13:59:20 +0100 (Thu, 29 Jan 2009)
New Revision: 388

Modified:
   branches/distr-2.1/pkg/distrDoc/inst/doc/distr.Rnw
Log:
minor correction sqrt((n-1)/n)*sd(x) ...

Modified: branches/distr-2.1/pkg/distrDoc/inst/doc/distr.Rnw
===================================================================
--- branches/distr-2.1/pkg/distrDoc/inst/doc/distr.Rnw	2009-01-29 12:41:26 UTC (rev 387)
+++ branches/distr-2.1/pkg/distrDoc/inst/doc/distr.Rnw	2009-01-29 12:59:20 UTC (rev 388)
@@ -1940,7 +1940,8 @@
 <<NormScaleFam, eval = FALSE>>=
 setMethod("mleCalc", signature(x = "numeric", PFam = "NormScaleFamily"),
            function(x, PFam, ...){
-           theta <- sd(x); mn <- mean(distribution(PFam))
+           n <- length(x)
+           theta <- sqrt((n-1)/n)*sd(x); mn <- mean(distribution(PFam))
            ll <- -sum(dnorm(x, mean=mn, sd = theta, log=TRUE))
            names(ll) <- "neg.Loglikelihood"
            crit.fct <- function(sd)



More information about the Distr-commits mailing list