View source: R/CreateCovRegPlot.R
CreateCovRegPlot | R Documentation |
Plots for Fréchet regression for covariance matrices.
CreateCovRegPlot(x, optns = list())
x |
A |
optns |
A list of control options specified by |
Available control options are
A vector holding the indices of elements in x$Mout
at which the plots will be made. Default is
1:length(x$Mout)
when x$Mout
is of length no more than 3;
c(1,round(length(x$Mout)/2),length(x$Mout))
when x$Mout
is of length greater than 3.
An integer — default: 1; subsequent figures will be drawn in an optns$nrow
-by-
ceiling(length(ind.xout)/optns$nrow)
array.
Character with two choices, "continuous" and "categorical". The former plots the correlations in a continuous scale of colors by magnitude while the latter categorizes the positive and negative entries into two different colors. Default is "continuous"
Character, the ordering method of the correlation matrix.
"original"
for original order (default);
"AOE"
for the angular order of the eigenvectors;
"FPC"
for the first principal component order;
"hclust"
for the hierarchical clustering order, drawing 4 rectangles on the graph according to the hierarchical cluster;
"alphabet"
for alphabetical order.
Character, the visualization method of correlation matrix to be used. Currently, it supports seven methods, named "circle" (default), "square", "ellipse", "number", "pie", "shade" and "color".
Logical, indicating if output is shown as correlation or covariance matrix. Default is FALSE
and corresponds to a covariance matrix.
Character, "full" (default), "upper" or "lower", display full matrix, lower triangular or upper triangular matrix.
No return value.
#Example y input
n=20 # sample size
t=seq(0,1,length.out=100) # length of data
x = matrix(runif(n),n)
theta1 = theta2 = array(0,n)
for(i in 1:n){
theta1[i] = rnorm(1,x[i],x[i]^2)
theta2[i] = rnorm(1,x[i]/2,(1-x[i])^2)
}
y = matrix(0,n,length(t))
phi1 = sqrt(3)*t
phi2 = sqrt(6/5)*(1-t/2)
y = theta1%*%t(phi1) + theta2 %*% t(phi2)
xout = matrix(c(0.25,0.5,0.75),3)
Cov_est=GloCovReg(x=x,y=y,xout=xout,optns=list(corrOut = FALSE, metric="power",alpha=3))
CreateCovRegPlot(Cov_est, optns = list(ind.xout = 2, plot.method = "shade"))
CreateCovRegPlot(Cov_est, optns = list(plot.method = "color"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.