[Robast-commits] r383 - in branches/robast-0.7/pkg/RobAStBase: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 6 15:06:26 CEST 2009


Author: ruckdeschel
Date: 2009-10-06 15:06:26 +0200 (Tue, 06 Oct 2009)
New Revision: 383

Modified:
   branches/robast-0.7/pkg/RobAStBase/R/qqplot.R
   branches/robast-0.7/pkg/RobAStBase/man/qqplot.Rd
Log:
RobAstBase: qqplot: "InfRobModel" method: 
  +reworked distance routine --- threw errors in 1 dim. 
  +reworked example

Modified: branches/robast-0.7/pkg/RobAStBase/R/qqplot.R
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/R/qqplot.R	2009-10-06 11:13:19 UTC (rev 382)
+++ branches/robast-0.7/pkg/RobAStBase/R/qqplot.R	2009-10-06 13:06:26 UTC (rev 383)
@@ -46,13 +46,11 @@
 
 
 ## into RobAStBase
-setMethod("qqplot", signature(x = "ANY",
-                              y = "InfRobModel"), function(x, y,
-                              n = length(x), withIdLine = TRUE, withConf = TRUE,
-             withConf.pw  = withConf,   ### shall pointwise confidence lines be plotted
-             withConf.sim = withConf,   ### shall simultaneous confidence lines be plotted
-    plot.it = TRUE, xlab = deparse(substitute(x)),
-    ylab = deparse(substitute(y)), ..., n.adj = TRUE){
+setMethod("qqplot", signature(x = "ANY", y = "InfRobModel"),
+      function(x, y, n = length(x), withIdLine = TRUE, withConf = TRUE,
+               withConf.pw  = withConf,  withConf.sim = withConf,
+               plot.it = TRUE, xlab = deparse(substitute(x)),
+               ylab = deparse(substitute(y)), ..., n.adj = TRUE){
 
     mc <- match.call(call = sys.call(sys.parent(1)))
     if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
@@ -68,10 +66,10 @@
     mcl$n <- n
     mcl$y <- y at center
 
-    L2D <- L2deriv(y at center)
     FI <- PosSemDefSymmMatrix(FisherInfo(y at center))
-    L2Dx <- sapply(x, function(z) evalRandVar(L2D,z)[[1]])
-    scx <-  solve(sqrt(FI),matrix(L2Dx,ncol=length(x)))
+    L2D <- as(diag(nrow(FI)) %*% L2deriv(y at center), "EuclRandVariable")
+    L2Dx <- evalRandVar(L2D,matrix(x))[,,1]
+    scx <-  solve(sqrt(FI),L2Dx)
     xD <- fct(distance)(scx)
     x.cex <- 3/(1+log(1+xD))
     mcl$cex.pch <- x.cex

Modified: branches/robast-0.7/pkg/RobAStBase/man/qqplot.Rd
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/man/qqplot.Rd	2009-10-06 11:13:19 UTC (rev 382)
+++ branches/robast-0.7/pkg/RobAStBase/man/qqplot.Rd	2009-10-06 13:06:26 UTC (rev 383)
@@ -124,9 +124,10 @@
 
 \examples{
 qqplot(r(Norm(15,sqrt(30)))(40), Chisq(df=15))
-RobM <- InfRobModel(center = NormLocationFamily(),
+RobM <- InfRobModel(center = NormLocationFamily(mean=13,sd=sqrt(28)),
                     neighbor = ContNeighborhood(radius = 0.4))
-qqplot(r(Norm(15,sqrt(30)))(40), RobM)
+x <- r(Norm(15,sqrt(30)))(20)
+qqplot(x, RobM)
 ## further examples for ANY,kStepEstimator-method
 ## in example to roptest() in package ROptEst
 }



More information about the Robast-commits mailing list