https://github.com/cran/ConvergenceConcepts
Raw File
Tip revision: 8709684e3587abe34550db683638acedc0e07660 authored by P. Lafaye de Micheaux on 10 February 2010, 00:00:00 UTC
version 1.0
Tip revision: 8709684
law-plot3d.R
law.plot3d <- function(data,probfunc,tinf=-5,tsup=5) {

  nmax <- ncol(data)

  Fhat<-function(x) {
    n<-x[1]
    t<-x[2]
    Fn<-ecdf(data[,n])
    Fn(t)
  }

  g <- expand.grid(t = seq(from=tinf,to=tsup,length=10), n = 1:nmax)
  
  Mymat <- g[,2:1]

  g$z <- abs(apply(Mymat,FUN=Fhat,MARGIN=1)-probfunc(g$t))
  
  print(wireframe(z ~ t + n, data = g,scales = list(arrows = FALSE),drape = TRUE, colorkey = TRUE,screen = list(z = -50, x = -70),zlab=list(expression(hat(l)[n]~'(t)=|'~hat(F)[n]~'(t)-'~F~'(t)|'),rot=90) ,main="Convergence in law?"))
  

}
back to top