[spcopula-commits] r78 - / pkg pkg/R pkg/demo pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 8 17:35:59 CET 2013


Author: ben_graeler
Date: 2013-01-08 17:35:59 +0100 (Tue, 08 Jan 2013)
New Revision: 78

Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/asCopula.R
   pkg/R/cqsCopula.R
   pkg/R/empiricalCopula.R
   pkg/R/returnPeriods.R
   pkg/R/spCopula.R
   pkg/R/spatialPreparation.R
   pkg/R/utilities.R
   pkg/demo/spCopula_estimation.R
   pkg/man/dduCopula.Rd
   pkg/man/dependencePlot.Rd
   pkg/man/spCopula-class.Rd
   pkg/man/unitScatter.Rd
   pkg/man/vineCopula.Rd
   spcopula_0.1-1.tar.gz
   spcopula_0.1-1.zip
Log:
- changed arguments for dCopula and pCopula for the spatial and spatio-temporal copulas
- various cosmnetics
- use wrapper to C-functions from copula

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/DESCRIPTION	2013-01-08 16:35:59 UTC (rev 78)
@@ -5,10 +5,10 @@
 Date: 2013-01-06
 Author: Benedikt Graeler
 Maintainer: Benedikt Graeler <ben.graeler at uni-muenster.de>
-Description: This package provides a framework to analyse spatial and spatio-temporal data provided in the format of the spacetime package with copulas. Additionally, support for calculating different multivariate return periods is implemented.
+Description: This package provides a framework to analyse via copulas spatial and spatio-temporal data provided in the format of the spacetime package. Additionally, support for calculating different multivariate return periods is implemented.
 License: GPL-2
 LazyLoad: yes
-Depends: copula (>= 0.999-5), spacetime (>= 1.0-2), CDVine, methods, lattice, R (>= 2.15.0)
+Depends: copula (>= 0.999-5), spacetime (>= 1.0-2), CDVine, methods, R (>= 2.15.0)
 URL: http://r-forge.r-project.org/projects/spcopula/
 Collate:
   Classes.R

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/NAMESPACE	2013-01-08 16:35:59 UTC (rev 78)
@@ -1,8 +1,5 @@
-# useDynLib(spcopula)
+import(copula, spacetime, CDVine)
 
-import(copula, spacetime, CDVine, lattice)
-# importClassesFrom(spacetime, STFDF)
-
 # constructor
 export(asCopula, cqsCopula)
 export(BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula)

Modified: pkg/R/asCopula.R
===================================================================
--- pkg/R/asCopula.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/asCopula.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -85,35 +85,35 @@
           })
 setMethod("ddvCopula", signature("matrix", "asCopula"),ddvASC2)
 
-## random number generater
+## random number generator
 # incorporating the inverse of the partial derivative that is solved numerically using optimize
 
 ## inverse partial derivative 
 
 invdduASC2 <- function (u, copula, y) {
-    if (length(u)!=length(y)) 
-        stop("Length of u and y differ!")
+  if (length(u)!=length(y)) 
+    stop("Length of u and y differ!")
+  
+  a <- copula at parameters[1]
+  b <- copula at parameters[2]
 
-    a <- copula at parameters[1]
-    b <- copula at parameters[2]
-
 # solving the cubic equation: u^3 * c3 + u^2 * c2 + u * c1 + c0 = 0
-    usq <- u^2
-    c3 <- (a-b)*(-3*usq+4*u-1)
-    c2 <- (a-b)*(1-4*u+3*usq)+b*(- 1 + 2*u)
-    c1 <- 1+b*(1-2*u)
-    c0 <- -y
+  usq <- u^2
+  c3 <- (a-b)*(-3*usq+4*u-1)
+  c2 <- (a-b)*(1-4*u+3*usq)+b*(- 1 + 2*u)
+  c1 <- 1+b*(1-2*u)
+  c0 <- -y
 
-v <- solveCubicEq(c3,c2,c1,c0) # from cqsCopula.R
+  v <- solveCubicEq(c3,c2,c1,c0) # from cqsCopula.R
 
-filter <- function(vec){
-  vec <- vec[!is.na(vec)]
-  return(vec[vec >= 0 & vec <= 1])
+  filter <- function(vec) {
+    vec <- vec[!is.na(vec)]
+    return(vec[vec >= 0 & vec <= 1])
+  }
+    
+  return(apply(v,1,filter))
 }
 
-return(apply(v,1,filter))
-}
-
 setMethod("invdduCopula", signature("numeric","asCopula","numeric"),invdduASC2)
 
 ## inverse partial derivative ddv
@@ -145,9 +145,13 @@
 
 ## random number generator
 rASC2 <- function (n, copula) {
-    u <- runif(n, min = 0, max = 1)
-    y <- runif(n, min = 0, max = 1)
-    return(cbind(u, invdduASC2(u, copula, y) ))
+  u <- runif(n, min = 0, max = 1)
+  y <- runif(n, min = 0, max = 1)
+    
+  res <- cbind(u, invdduASC2(u, copula, y))
+  colnames(res) <- c("u","v")
+  
+  return(res)
 }
 
 setMethod("rCopula", signature("numeric", "asCopula"), rASC2)

Modified: pkg/R/cqsCopula.R
===================================================================
--- pkg/R/cqsCopula.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/cqsCopula.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -188,9 +188,13 @@
 ## random number generator
 
 rCQSec <- function (n, copula) {
-    u <- runif(n, min = 0, max = 1)
-    y <- runif(n, min = 0, max = 1)
-    return(cbind(u, invdduCQSec(u, copula, y) ))
+  u <- runif(n, min = 0, max = 1)
+  y <- runif(n, min = 0, max = 1)
+    
+  res <- cbind(u, invdduCQSec(u, copula, y))
+  colnames(res) <- c("u","v")
+    
+  return(res)
 }
 
 setMethod("rCopula", signature("numeric","cqsCopula"), rCQSec)

Modified: pkg/R/empiricalCopula.R
===================================================================
--- pkg/R/empiricalCopula.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/empiricalCopula.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -35,22 +35,14 @@
 ## jcdf ##
 # from package copula
 pempCop.C <- function(u, copula) {
-#   Cn(u, copula at sample, do.pobs=F, method="C") # preferred use instead of direct C-code from copula <=0.999-5
-
-  # annoying hack, to be removed after release of copula 0.999-6 with the line above
-  if("RmultCn" %in% names(getDLLRegisteredRoutines(getLoadedDLLs()[["copula"]][["path"]])[[1]])) {
-    if(getDLLRegisteredRoutines(getLoadedDLLs()[["copula"]][["path"]])[[1]][["RmultCn"]]$numParameters == 6)
-       .C("RmultCn", as.double(copula at sample), as.integer(nrow(copula at sample)),
-         copula at dimension, as.double(u), as.integer(nrow(u)), as.double(u[,1]),
-         PACKAGE="copula")[[6]]
-    else
-      .C("RmultCn", as.double(copula at sample), as.integer(nrow(copula at sample)),
-         copula at dimension, as.double(u), as.integer(nrow(u)), as.double(u[,1]),
-         as.double(0), PACKAGE="copula")[[6]]
-  } else # copula > 0.999-5
-    .C("Cn_C", as.double(copula at sample), as.integer(nrow(copula at sample)),
-       copula at dimension, as.double(u), as.integer(nrow(u)), as.double(u[,1]),
-       as.double(0), PACKAGE="copula")[[6]]
+  # r-forge hack, to be removed after release of copula 0.999-6 with the line above
+  if(length(formals(Cn))==2) {
+    return(Cn(copula at sample,u))
+  }
+  if (length(formals(Cn))== 5) {
+    return(Cn(u, copula at sample, do.pobs=FALSE, offset=0, method="C"))
+  }
+  stop(length(formals(Cn)))
 }
 
 setMethod("pCopula", signature("numeric", "empiricalCopula"),

Modified: pkg/R/returnPeriods.R
===================================================================
--- pkg/R/returnPeriods.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/returnPeriods.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -8,6 +8,7 @@
   empKenFun <- function(tlevel) {
     sapply(tlevel,function(t) sum(ken<=t))/nrow(sample)
   }
+  
   return(empKenFun)
 }
 

Modified: pkg/R/spCopula.R
===================================================================
--- pkg/R/spCopula.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/spCopula.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -233,38 +233,35 @@
 
 
 # u 
-#   three column matrix providing the transformed pairs and their respective 
+#   two column matrix providing the transformed pairs and their respective 
 #   separation distances
-pSpCopula <- function (u, copula) {
-  if (!is.list(u) || !length(u)>=2) stop("Point pairs need to be provided with their separating distance as a list.")
+# h providing the separating distance(s)
+# block
+#   block distances, pairs are assumed to be ordered block wise
+pSpCopula <- function (u, copula, h, block=1) {
+  if (missing(h)) stop("Point pairs need to be provided with their separating distance \"h\".")
   
-  pairs <- u[[1]]
-  if(!is.matrix(pairs)) pairs <- matrix(pairs,ncol=2)
-  n <- nrow(pairs)
+  n <- nrow(u)
   
-  if(length(u)==3) {
-    block <- u[[3]]
-    if (n%%block != 0) stop("The block size is not a multiple of the data length:",n)
-  } else block <- 1
+  if (n%%block != 0) stop("The block size is not a multiple of the data length:",n)
   
-  h <- u[[2]]
-  if(length(h)>1 && length(h)!=nrow(u[[1]])) {
+  if(length(h)>1 && length(h)!=n) {
     stop("The distance vector must either be of the same length as rows in the data pairs or a single value.")
   }
   
   
   if(is.null(copula at calibMoa(normalCopula(0),0))) {
-    res <- spConCop(pCopula, copula, pairs, rep(h,length.out=nrow(pairs)))
+    res <- spConCop(pCopula, copula, u, rep(h,length.out=nrow(pairs)))
   } else {
     if(length(h)>1) {
       if (block == 1){
         ordering <- order(h)
         
         # ascending sorted pairs allow for easy evaluation
-        pairs <- pairs[ordering,,drop=FALSE] 
+        u <- u[ordering,,drop=FALSE] 
         h <- h[ordering]
         
-        res <- spDepFunCop(pCopula, copula, pairs, h)
+        res <- spDepFunCop(pCopula, copula, u, h)
         
         # reordering the values
         res <- res[order(ordering)]
@@ -272,55 +269,53 @@
         res <- NULL
         for(i in 1:(n%/%block)) {
           res <- c(res, spDepFunCopSnglDist(pCopula, copula, 
-                                            pairs[((i-1)*block+1):(i*block),], 
+                                            u[((i-1)*block+1):(i*block),], 
                                             h[i*block]))
         }
       }
     } else {
-      res <- spDepFunCopSnglDist(pCopula, copula, pairs, h)
+      res <- spDepFunCopSnglDist(pCopula, copula, u, h)
     }
   }
   
   return(res)
 }
 
-setMethod("pCopula", signature("list","spCopula"), pSpCopula)
+setMethod(pCopula, signature("numeric","spCopula"), 
+          function(u, copula, ...) pSpCopula(matrix(u,ncol=2),copula, ...))
+setMethod(pCopula, signature("matrix","spCopula"), pSpCopula)
 
 ## spatial Copula density ##
 
 # u 
 #   three column matrix providing the transformed pairs and their respective 
 #   separation distances
-dSpCopula <- function (u, copula, log=F) {
-  if (!is.list(u) || !length(u)>=2) stop("Point pairs need to be provided with their separating distance as a list.")
+dSpCopula <- function (u, copula, log=F, h, block=1) {
+  if (missing(h)) stop("Point pairs need to be provided with their separating distance \"h\".")
   
-  pairs <- u[[1]]
-  n <- nrow(pairs)
+  n <- nrow(u)
   
-  if(length(u)==3) {
-    block <- u[[3]]
-    if (n%%block != 0) stop("The block size is not a multiple of the data length:",n)
-  } else block <- 1
+  if (n%%block != 0) stop("The block size is not a multiple of the data length:",n)
   
-  h <- u[[2]]
-  if(length(h)>1 && length(h)!=nrow(u[[1]])) {
+  if(length(h)>1 && length(h)!=n) {
     stop("The distance vector must either be of the same length as rows in the data pairs or a single value.")
   }
   
   if(is.null(copula at calibMoa(normalCopula(0),0))){
-    res <- spConCop(dCopula, copula, pairs, rep(h, length.out=nrow(pairs)), 
+    res <- spConCop(dCopula, copula, u, rep(h, length.out=nrow(pairs)), 
                     do.logs=log, log=log)
   }
   else {
+    cat("Yes \n")
     if(length(h)>1) {
       if (block == 1){
         ordering <- order(h)
         
         # ascending sorted pairs allow for easy evaluation
-        pairs <- pairs[ordering,,drop=FALSE] 
+        u <- u[ordering,,drop=FALSE] 
         h <- h[ordering]
         
-        res <- spDepFunCop(dCopula, copula, pairs, h, do.logs=log, log=log)
+        res <- spDepFunCop(dCopula, copula, u, h, do.logs=log, log=log)
         
         # reordering the values
         res <- res[order(ordering)]
@@ -328,19 +323,21 @@
         res <- NULL
         for(i in 1:(n%/%block)) {
           res <- c(res, spDepFunCopSnglDist(dCopula, copula, 
-                                            pairs[((i-1)*block+1):(i*block),], 
+                                            u[((i-1)*block+1):(i*block),], 
                                             h[i*block], do.logs=log, log=log))
         }
       }
     } else {
-      res <- spDepFunCopSnglDist(dCopula, copula, pairs, h, do.logs=log, log=log)
+      res <- spDepFunCopSnglDist(dCopula, copula, u, h, do.logs=log, log=log)
     }
   }
   
   return(res)
 }
 
-setMethod(dCopula, signature("list","spCopula"), dSpCopula)
+setMethod(dCopula, signature("numeric","spCopula"), 
+          function(u, copula, ...) dSpCopula(matrix(u,ncol=2), copula, ...))
+setMethod(dCopula, signature("matrix","spCopula"), dSpCopula)
 
 ## partial derivatives ##
 

Modified: pkg/R/spatialPreparation.R
===================================================================
--- pkg/R/spatialPreparation.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/spatialPreparation.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -100,30 +100,6 @@
 return(neighbourhood(as.data.frame(lData), dists, SpatialPoints(spData), index))
 }
 
-## testing ## 
-# data(meuse)
-# coordinates(meuse) <- ~x+y
-# str(SpatialPoints(meuse))
-# 
-# neighbourSet <- getNeighbours(meuse,size=5)
-# 
-# str(neighbourSet at index)
-# 
-# library(lattice)
-# spplot(neighbourSet,"zinc",col.regions=bpy.colors())
-
-# 
-# as.data.frame(array(1:18,dim=c(2,3,3)))
-# 
-# ?spplot
-# 
-# array(matrix(runif(3*155),ncol=3),dim=c(155,3))
-# 
-# names(neighb)
-# 
-# ## transformation of the sample by local neighborhoods ##
-# 
-
 #############
 ## BINNING ##
 #############

Modified: pkg/R/utilities.R
===================================================================
--- pkg/R/utilities.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/R/utilities.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -17,69 +17,42 @@
   return(res)
 }
 
-# strength of dependence scatterplot
-myPanel.smoothScatter <- function(x, y = NULL, nbin = 64, cuts = 255, bandwidth, colramp, 
-  transformation = function(x) x, pch = ".", cex = 1, col = "black", range.x, ..., raster = FALSE, subscripts) {
-  if (missing(colramp)) 
-    colramp <- function(x) rev(heat.colors(x))
-  x <- as.numeric(x)
-  y <- as.numeric(y)
-  if(min(x)<0 | max(x)>1 | min(y) < 0 | max(y) > 1) {
-    x <- rankTransform(x)
-    y <- rankTransform(y)
-    warning("At least one of the margins seems to exceed [0,1] and has been transformed using rankTransform.")
-  }
-  xy <- xy.coords(x, y)
-  x <- cbind(xy$x, xy$y)[!(is.na(xy$x) | is.na(xy$y)), , drop = FALSE]
-  if (nrow(x) < 1) return()
-  map <- lattice:::.smoothScatterCalcDensity(x, nbin, bandwidth, range.x)
-  xm <- map$x1
-  ym <- map$x2
-  dens <- map$fhat
-  dens <- array(transformation(dens), dim = dim(dens))
-  PFUN <- if (raster) 
-    panel.levelplot.raster
-  else panel.levelplot
-  PFUN(x = rep(xm, length(ym)), y = rep(ym, each = length(xm)), 
-       z = as.numeric(dens), subscripts = TRUE, at = seq(from = 0, 
-       to = 1.01 * max(dens), length = cuts + 2), col.regions = colramp(cuts + 1), ...)
-}
-
-dependencePlot <- function(formula=NULL, smpl, cuts=15, bandwidth=.075, transformation=function (x) x, ..., range.x=list(c(0,1),c(0,1))) {
-  smpl <- as.data.frame(smpl)
-  if(is.null(formula)) {
+##
+dependencePlot <- function(var=NULL, smpl, bandwidth=0.075, 
+                           main="Stength of dependece", 
+                           transformation=function (x) x, ...) {
+  if(is.null(var)) {
     if (ncol(smpl)>2) {
-      warning("smpl contains more than 2 columns and no formula is given. The first two columns are plotted.")
-      smpl <- as.data.frame(smpl[,1:2])
+      smpl <- smpl[,1:2]
     }
-    colnames(smpl) <- c("u","v")
-    formula <- u~v
+  } else {
+    smpl <- smpl[,var]
   }
-
-  xyplot(formula, smpl, panel=myPanel.smoothScatter,
-  aspect="iso", xlim=c(0,1), ylim=c(0,1), cuts=cuts, bandwidth=bandwidth, transformation=transformation, range.x=range.x, ...)
+  
+  smoothScatter(smpl,bandwidth=bandwidth, asp=1, xlim=c(0,1), ylim=c(0,1), 
+                nrpoints=0, main=main,
+                transformation=transformation, ...)
 }
 
 ##
-unitScatter <- function(formula=NULL, smpl, ...) {
-  smpl <- as.data.frame(smpl)
-  if(is.null(formula)) {
+unitScatter <- function(var=NULL, smpl, ...) {
+  
+  if(is.null(var)) {
     if (ncol(smpl)>2) {
-      warning("smpl contains more than 2 columns and no formula is given. The first two columns are plotted.")
-      smpl <- as.data.frame(smpl[,1:2])
+      smpl <- smpl[,1:2]
     }
-    colnames(smpl) <- c("u","v")
-    formula <- v~u
+  } else {
+    smpl <- smpl[,var]
   }
 
-  for(variable in all.vars(formula)){
+  for(variable in var){
     if( min(smpl[,variable])<0 | max(smpl[,variable])>1) {
       smpl[,variable] <- rank(smpl[,variable])/(length(smpl[,variable])+1)
       warning("The variable ",variable," seems to exceed [0,1] and has been transformed using the rank order transformation.")
     }
   }
 
-  xyplot(formula, smpl, aspect="iso", xlim=c(0,1), ylim=c(0,1), ...)
+  plot(smpl, asp=1, xlim=c(0,1), ylim=c(0,1), ...)
 }
 
 univScatter <- function(formula=NULL, smpl) {

Modified: pkg/demo/spCopula_estimation.R
===================================================================
--- pkg/demo/spCopula_estimation.R	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/demo/spCopula_estimation.R	2013-01-08 16:35:59 UTC (rev 78)
@@ -59,8 +59,8 @@
 spLoglik <- NULL
 for(i in 1:length(bins$lags)) { # i <- 8
   spLoglik <- c(spLoglik,
-                sum(dCopula(list(u=bins$lagData[[i]], h=bins$lags[[i]][,3]), 
-                                spCop,log=T)))
+                sum(dCopula(u=bins$lagData[[i]], spCop,log=T,
+                            h=bins$lags[[i]][,3])))
 }
 
 plot(spLoglik, ylab="log-likelihood", xlim=c(1,11)) 

Modified: pkg/man/dduCopula.Rd
===================================================================
--- pkg/man/dduCopula.Rd	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/man/dduCopula.Rd	2013-01-08 16:35:59 UTC (rev 78)
@@ -44,7 +44,7 @@
 
 # vs. conditional probabilities of an asymmetric copula given v
 asGivenV <- ddvCopula(asCopSmpl[,c(2,1)],asCop)
-xyplot(asGivenU ~ asGivenV, asp=1)
+unitScatter(smpl=cbind(asGivenU, asGivenV))
 
 normalCop <- normalCopula(.6)
 normCopSmpl <- rCopula(100,normalCop)
@@ -56,7 +56,7 @@
 
 # vs. conditional probabilities of a Gaussian copula given v
 normGivenV <- ddvCopula(normCopSmpl[,c(2,1)],normalCop)
-xyplot(normGivenU ~ normGivenV)
+unitScatter(smpl=cbind(normGivenU, normGivenV))
 }
 
 \keyword{partial derivative}

Modified: pkg/man/dependencePlot.Rd
===================================================================
--- pkg/man/dependencePlot.Rd	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/man/dependencePlot.Rd	2013-01-08 16:35:59 UTC (rev 78)
@@ -7,32 +7,29 @@
 Plots a kernel smoothed scatterplot of the provided rank-transformed sample. The work is done by the function \code{\link{panel.smoothScatter}}.
 }
 \usage{
-dependencePlot(formula = NULL, smpl, cuts = 15, bandwidth = 0.075, transformation = function(x) x, ..., range.x = list(c(0, 1), c(0, 1)))
+dependencePlot(var = NULL, smpl, bandwidth = 0.075,  main="Stength of dependece", transformation = function(x) x, ...)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{formula}{
-the formula as in common lattice plotting
+  \item{var}{
+Column IDs or variable names to be used. If not provided, the first two columns will be used.
 }
   \item{smpl}{
-can be a two-column matrix holding the data, no formula is needed
+a matrix (two-columns at least) holding the data
 }
-  \item{cuts}{
-the cuts to change colors
-}
   \item{bandwidth}{
 the bandwidth passed to the smoothing kernel
 }
+\item{main}{
+the tilte of the plot
+}
   \item{transformation}{
 a transformation passed to the kernel
 }
   \item{\dots}{
 passed on to the function \code{\link{panel.smoothScatter}}
 }
-  \item{range.x}{
-passed on to the function \code{\link{panel.smoothScatter}}
 }
-}
 \details{
 see \code{\link{panel.smoothScatter}}
 }
@@ -43,11 +40,11 @@
 Benedikt Graeler
 }
 \note{
-This is simple wrapper to \code{\link{panel.smoothScatter}}.
+This is simple wrapper to \code{\link{smoothScatter}}.
 }
 
 \seealso{
-\code{\link{panel.smoothScatter}}
+\code{\link{smoothScatter}}
 }
 \examples{
 dependencePlot(smpl=rCopula(500,asCopula(c(-1,1))))

Modified: pkg/man/spCopula-class.Rd
===================================================================
--- pkg/man/spCopula-class.Rd	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/man/spCopula-class.Rd	2013-01-08 16:35:59 UTC (rev 78)
@@ -46,8 +46,8 @@
 
 \examples{
 data(spCopDemo) # data from demo(spcopula_estimation)
-dCopula(list(u=matrix(c(.3,.3,.7,.7),ncol=2),h=c(200,400)),spCop)
-pCopula(list(u=matrix(c(.3,.3,.7,.7),ncol=2),h=c(200,400)),spCop)
+# dCopula(u=matrix(c(.3,.3,.7,.7),ncol=2),spCop,h=c(200,400))
+pCopula(u=matrix(c(.3,.3,.7,.7),ncol=2),spCop,h=c(200,400))
 }
 \keyword{classes}
 \keyword{spcopula}

Modified: pkg/man/unitScatter.Rd
===================================================================
--- pkg/man/unitScatter.Rd	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/man/unitScatter.Rd	2013-01-08 16:35:59 UTC (rev 78)
@@ -8,11 +8,11 @@
 Plots a sample on the unit-square. If needed, it will transform the sample using the rank order transformation as in \code{\link{rankTransform}}.
 }
 \usage{
-unitScatter(formula = NULL, smpl, ...)
+unitScatter(var = NULL, smpl, ...)
 }
 \arguments{
-  \item{formula}{
-A standard plotting formula to select the corresponding columns.
+  \item{var}{
+Column IDs or variable names to be used. If not provided, the first two columns will be used.
 }
   \item{smpl}{
 The data set to be used.
@@ -30,7 +30,7 @@
 \examples{
 data(loss)
 rt_loss <- rankTransform(loss[,1:2])
-unitScatter(loss~alae,rt_loss)
+unitScatter(smpl=rt_loss)
 }
 \keyword{ hplot }
 

Modified: pkg/man/vineCopula.Rd
===================================================================
--- pkg/man/vineCopula.Rd	2013-01-06 08:18:50 UTC (rev 77)
+++ pkg/man/vineCopula.Rd	2013-01-08 16:35:59 UTC (rev 78)
@@ -32,9 +32,7 @@
 \examples{
 vine <- vineCopula(list(frankCopula(.7), gumbelCopula(3), gumbelCopula(1)),
                    3, "c-vine")
-
-if(require(lattice))
-  cloud(V1~V2+V3, as.data.frame(rCopula(500,vine)))
+\dontrun{cloud(V1~V2+V3, as.data.frame(rCopula(500,vine)))}
 }
 \keyword{ mulitvariate }
 \keyword{ distribution }

Modified: spcopula_0.1-1.tar.gz
===================================================================
(Binary files differ)

Modified: spcopula_0.1-1.zip
===================================================================
(Binary files differ)



More information about the spcopula-commits mailing list