[Vinecopula-commits] r19 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Di Aug 27 09:29:02 CEST 2013
Author: ulf
Date: 2013-08-27 09:29:02 +0200 (Tue, 27 Aug 2013)
New Revision: 19
Modified:
pkg/R/RVineStructureSelect.r
pkg/R/RVineTreePlot.r
Log:
Mist, mist. Ich f?\195?\188rchte ich habe vergessen die beiden Files von Eike in das endgueltige Paket zu packen. Das waere echt sau dumm.
Modified: pkg/R/RVineStructureSelect.r
===================================================================
--- pkg/R/RVineStructureSelect.r 2013-08-16 07:49:30 UTC (rev 18)
+++ pkg/R/RVineStructureSelect.r 2013-08-27 07:29:02 UTC (rev 19)
@@ -2,38 +2,26 @@
if(type == 0) type = "RVine"
else if(type == 1) type = "CVine"
- else if(type == 2 || type == "DVine") stop("Code to determine the order of the nodes in a D-vine using the package TSP is provided as an example in the documentation of this function." )
if(type != "RVine" & type != "CVine") stop("Vine model not implemented.")
n = dim(data)[2]
d = dim(data)[1]
- if(dim(data)[1]<2)
- stop("Number of observations has to be at least 2.")
- if(d<2)
- stop("Dimension has to be at least 2.")
- if(any(data>1) || any(data<0))
- stop("Data has to be in the interval [0,1].")
- if(any(is.na(familyset))) {
- familyset <- c(1:10,13,14,16:20,23,24,26:30,33,34,36:40)
- }
- if(any(!(familyset %in% c(0,1:10,13,14,16:20,23,24,26:30,33,34,36:40))))
- stop("Copula family not implemented.")
- if(selectioncrit != "AIC" && selectioncrit != "BIC")
- stop("Selection criterion not implemented.")
- if(level < 0 || level > 1)
- stop("Significance level has to be between 0 and 1.")
+ if(dim(data)[1]<2) stop("Number of observations has to be at least 2.")
+ if(d<2) stop("Dimension has to be at least 2.")
+ if(any(data>1) || any(data<0)) stop("Data has be in the interval [0,1].")
+
+ if(!is.na(familyset[1])) for(i in 1:length(familyset)) if(!(familyset[i] %in% c(0,1:10,13,14,16:20,23,24,26:30,33,34,36:40))) stop("Copula family not implemented.")
+ if(selectioncrit != "AIC" && selectioncrit != "BIC") stop("Selection criterion not implemented.")
+ if(level < 0 & level > 1) stop("Significance level has to be between 0 and 1.")
- if(is.null(colnames(data)))
- colnames(data) = paste("V",1:n,sep="")
+ if(is.null(colnames(data))) colnames(data) = paste("V",1:n,sep="")
- if(is.na(trunclevel))
- trunclevel = d
+ if(is.na(trunclevel)) trunclevel = d
RVine = list(Tree = NULL, Graph=NULL)
- if(trunclevel == 0)
- familyset = 0
+ if(trunclevel == 0) familyset = 0
g = initializeFirstGraph(data,weights)
mst = findMaximumTauTree(g,mode=type)
Modified: pkg/R/RVineTreePlot.r
===================================================================
--- pkg/R/RVineTreePlot.r 2013-08-16 07:49:30 UTC (rev 18)
+++ pkg/R/RVineTreePlot.r 2013-08-27 07:29:02 UTC (rev 19)
@@ -1,6 +1,6 @@
RVineTreePlot = function(data=NULL, RVM, method="mle", max.df=30, max.BB=list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)), tree="ALL", edge.labels=c("family"), P=NULL){
- if(!is(RVM, "RVineMatrix")) stop("'RVM' has to be an RVineMatrix object.")
+ if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.")
if(edge.labels[1] != FALSE & !all(edge.labels %in% c("family","par","par2","theotau","emptau","pair"))) stop("Edge label not implemented.")
if(is.null(data) & any(edge.labels == "emptau")) stop("Empirical Kendall's tau values cannot be obtained if no data is provided.")
Mehr Informationen über die Mailingliste Vinecopula-commits