Description Usage Arguments Value Author(s) Examples
View source: R/CDVineCopulaConditional.r
This function overlays the scatterplot matrices of two multivariate datsets. Moreover, it shows the dependencies among all the pairs for both datsets.
1 2 3 |
data1, data2 |
Two |
col1, col2 |
Colors used for |
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 |
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.labels |
Number: character dimension of the printed variable names. Default |
cor.signif |
Number: number of significant numbers of the printed dependencies. Default |
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 |
A matrix of overlaying scatterplots of the multivariate datsets data1
and data2
, with
the dependencies of the pairs.
Emanuele Bevacqua
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.