[spcopula-commits] r140 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 23 09:51:10 CET 2015


Author: ben_graeler
Date: 2015-02-23 09:51:09 +0100 (Mon, 23 Feb 2015)
New Revision: 140

Modified:
   pkg/R/spCopula.R
Log:
- added rCopula for any spCopula object

Modified: pkg/R/spCopula.R
===================================================================
--- pkg/R/spCopula.R	2015-02-09 16:07:24 UTC (rev 139)
+++ pkg/R/spCopula.R	2015-02-23 08:51:09 UTC (rev 140)
@@ -4,7 +4,6 @@
 # param.names = "character" appropriate names
 # param.lowbnd = "numeric"  appropriate lower bounds
 # param.upbnd = "numeric"   appropriate upper bounds
-# fullname = "character"     messgae printed with "show"
 # components="list"         list of copulas (will be automatically supplemented 
 #			      by the independent copula)
 # distances="numeric"       the linking distances + the range (will be assigned
@@ -437,7 +436,17 @@
 
 setMethod("invddvCopula", signature("numeric", "spCopula"), invddvSpCopula)
 
+## simulation
 
+spCop.rCop <- function(n, copula, h) {
+  u <- runif(n)
+  v <- invdduCopula(u, copula, y=runif(n), h=h)
+  
+  return(cbind(u, v))
+}
+
+setMethod("rCopula", signature("numeric", "spCopula"), spCop.rCop)
+
 #############
 ##         ##
 ## FITTING ##



More information about the spcopula-commits mailing list