This book is in Open Review. I want your feedback to make the book better for you and other readers. To add your annotation, select some text and then click the on the pop-up menu. To see the annotations of others, click the in the upper right hand corner of the page
Cours 26 Version seulment corr >0.5
# inspired by the function of Catherine Williams
onlySignCorr <- function(df, file){
corr <- cor(df)
#drop perfect correlations
corr[corr == 1] <- NA
#turn into a 3-column table
corr <- as.data.frame(as.table(corr))
#remove the NA values from above
corr <- na.omit(corr)
#select significant values
corr <- subset(corr, abs(Freq) > 0.5)
#sort by highest correlation
corr <- corr[order(-abs(corr$Freq)),]
#turn corr back into matrix in order to plot with corrplot
mtx_corr <- reshape2::acast(corr, Var1~Var2, value.var="Freq")
#plot correlations visually
# corrplot(mtx_corr, type="upper", is.corr=FALSE, tl.col="black", na.label=" ")
# file <- "LiDAR_vs_LAI2200"
# file <- "LiDAR_Acquisitions"
png(paste("D:/Mes Donnees/PhD/Figures/lidar/Correlations/Correlations/Intensity_1m/Correlation_plot_",file,"_sup0_5.png", sep=""),
width = 1000, height = 743, pointsize=20)
corrplot(mtx_corr, method="color", col=brewer.pal(n=8, name="PuOr"),
type="upper",
# order="hclust",
addCoef.col = "white", # Add coefficient of correlation
tl.col="black", tl.cex = 0.8, #Text label color and rotation
number.cex = 0.55, # values
# hide correlation coefficient on the principal diagonal
diag=FALSE,
na.label=" ")
dev.off()
}
onlySignCorr(DF_cor_LiDARvsLAI2200, "LiDAR_vs_LAI2200")un autre type :
pairs.panels(iris,
method = "spearman", #coef de correlation de Spearman à droite
hist.col = "#00AFBB",
density = TRUE, # affiche la courbe de densite
ellipses = T # show correlation ellipses (interprétable que pour les var quanti)
)d’autres fcts de corplot : ggcorrplot()
26.2 Processus gaussiens
généraliser la procédure à une quantité infinie de dimensions kernlab::gausspr() -> écart-type des prédictions, donnant une appréciation de la précision du modèle