overplot {CDVineCopulaConditional}R Documentation

overplot

Description

This function overlays the scatterplot matrices of two multivariate datsets. Moreover, it shows the dependencies among all the pairs for both datsets.

Usage

overplot(data1, data2, col1 = "black", col2 = "grey", xlim = NA,
  ylim = NA, labels = NA, method = "pearson", cex.cor = 1,
  cex.labels = 1, cor.signif = 2, cex.axis = 1, pch1 = 1, pch2 = 1)

Arguments

data1, data2

Two N x d matrices of data to be plotted.

col1, col2

Colors used for data1 and data2 during the plot. Default is col1="black" and col2="grey".

xlim, ylim

Two bidimensional vectors indicating the limits of x and y axes for all the scatterplots. If not given, they are authomatically computed for each of the scatterplots.

labels

A character vector with the variable names to be printed (if not given, the names of data1 variables are printed).

method

Character indicating the dependence types to be computed between the pairs. Possibilites: "kendall", "spearman" and "pearson" (default)

cex.cor

Number: character dimension of the printed dependencies. Default cex.cor=1.

cex.labels

Number: character dimension of the printed variable names. Default cex.labels=1.

cor.signif

Number: number of significant numbers of the printed dependencies. Default cor.signif=2.

cex.axis

Number: dimension of the axis numeric values. Default cex.axis=1.

pch1, pch2

Paramter to specify the symbols to use when plotting points of data1 and data2.Default is pch1=1 and pch2=1.

Value

A matrix of overlaying scatterplots of the multivariate datsets data1 and data2, with the dependencies of the pairs.

Author(s)

Emanuele Bevacqua

Examples


# Example 1

# Read and prepare the data for the plot
data(dataset) 
data1 <- dataset$data[1:300,]
data2 <- dataset$data[301:600,]
overplot(data1,data2,xlim=c(0,1),ylim=c(0,1),method="kendall")



## Not run: 
# Example 2

# Read and prepare the data for the plot
data(dataset) 
data <- dataset$data[1:200,1:5]
colnames(data) <- c("Y1","Y2","X3","X4","X5")

# Fit copula families for the defined vine:
ListVines <- CDVineCondListMatrices(data,Nx=3)
Matrix=ListVines$CVine[[1]]
RVM <- CDVineCondFit(data,Nx=3,Matrix=Matrix)

# Simulate data:
d=dim(RVM$Matrix)[1]
cond1 <- data[,RVM$Matrix[(d+1)-1,(d+1)-1]]
cond2 <- data[,RVM$Matrix[(d+1)-2,(d+1)-2]]
cond3 <- data[,RVM$Matrix[(d+1)-3,(d+1)-3]]
condition <- cbind(cond1,cond2,cond3)
Sim <- CDVineCondSim(RVM,condition)

# Plot the simulated variables Sim over the observed
Sim <- data.frame(Sim)
overplot(data[,1:2],Sim[,1:2],xlim=c(0,1),ylim=c(0,1),method="spearman")
overplot(data,Sim,xlim=c(0,1),ylim=c(0,1),method="spearman")

## End(Not run)


[Package CDVineCopulaConditional version 0.1.1 Index]