Fichier:Correlation_examples2.svg
De Wikipedia, l'encyclopédie encyclopedia
Fichier d’origine (Fichier SVG, nominalement de 506 × 231 pixels, taille : 2,18 Mio)
Ce fichier et sa description proviennent de Wikimedia Commons.
Description
DescriptionCorrelation examples2.svg |
English: redesign File:Correlation_examples.png using vector graphics (SVG file) |
Date | |
Source | Travail personnel, original uploader was Imagecreator |
Auteur | DenisBoigelot, original uploader was Imagecreator |
Autorisation (Réutilisation de ce fichier) |
Released into the public domain (by the authors). |
Autres versions |
Œuvres dérivées de ce fichier : CovrarianceCorrelation.svg File:Correlation_examples.png |
#Title: An example of the correlation of x and y for various distributions of (x,y) pairs
#Tags: Mathematics; Statistics; Correlation
#Author: Denis Boigelot
#Packets needed : mvtnorm (rmvnorm), RSVGTipsDevice (devSVGTips)
#How to use: output()
#
#This is an translated version in R of an Matematica 6 code by Imagecreator.
library(mvtnorm)
library(RSVGTipsDevice)
MyPlot <- function(xy, xlim = c(-4, 4), ylim = c(-4, 4), eps = 1e-15) {
title = round(cor(xy[,1], xy[,2]), 1)
if (sd(xy[,2]) < eps) title = "" # corr. coeff. is undefined
plot(xy, main = title, xlab = "", ylab = "",
col = "darkblue", pch = 16, cex = 0.2,
xaxt = "n", yaxt = "n", bty = "n",
xlim = xlim, ylim = ylim)
}
MvNormal <- function(n = 1000, cor = 0.8) {
for (i in cor) {
sd = matrix(c(1, i, i, 1), ncol = 2)
x = rmvnorm(n, c(0, 0), sd)
MyPlot(x)
}
}
rotation <- function(t, X) return(X %*% matrix(c(cos(t), sin(t), -sin(t), cos(t)), ncol = 2))
RotNormal <- function(n = 1000, t = pi/2) {
sd = matrix(c(1, 1, 1, 1), ncol = 2)
x = rmvnorm(n, c(0, 0), sd)
for (i in t)
MyPlot(rotation(i, x))
}
Others <- function(n = 1000) {
x = runif(n, -1, 1)
y = 4 * (x^2 - 1/2)^2 + runif(n, -1, 1)/3
MyPlot(cbind(x,y), xlim = c(-1, 1), ylim = c(-1/3, 1+1/3))
y = runif(n, -1, 1)
xy = rotation(-pi/8, cbind(x,y))
lim = sqrt(2+sqrt(2)) / sqrt(2)
MyPlot(xy, xlim = c(-lim, lim), ylim = c(-lim, lim))
xy = rotation(-pi/8, xy)
MyPlot(xy, xlim = c(-sqrt(2), sqrt(2)), ylim = c(-sqrt(2), sqrt(2)))
y = 2*x^2 + runif(n, -1, 1)
MyPlot(cbind(x,y), xlim = c(-1, 1), ylim = c(-1, 3))
y = (x^2 + runif(n, 0, 1/2)) * sample(seq(-1, 1, 2), n, replace = TRUE)
MyPlot(cbind(x,y), xlim = c(-1.5, 1.5), ylim = c(-1.5, 1.5))
y = cos(x*pi) + rnorm(n, 0, 1/8)
x = sin(x*pi) + rnorm(n, 0, 1/8)
MyPlot(cbind(x,y), xlim = c(-1.5, 1.5), ylim = c(-1.5, 1.5))
xy1 = rmvnorm(n/4, c( 3, 3))
xy2 = rmvnorm(n/4, c(-3, 3))
xy3 = rmvnorm(n/4, c(-3, -3))
xy4 = rmvnorm(n/4, c( 3, -3))
MyPlot(rbind(xy1, xy2, xy3, xy4), xlim = c(-3-4, 3+4), ylim = c(-3-4, 3+4))
}
output <- function() {
devSVGTips(width = 7, height = 3.2) # remove first and last line for no svg exporting
par(mfrow = c(3, 7), oma = c(0,0,0,0), mar=c(2,2,2,0))
MvNormal(800, c(1.0, 0.8, 0.4, 0.0, -0.4, -0.8, -1.0));
RotNormal(200, c(0, pi/12, pi/6, pi/4, pi/2-pi/6, pi/2-pi/12, pi/2));
Others(800)
dev.off() # remove first and last line for no svg exporting
}
Conditions d’utilisation
Ce fichier est disponible selon les termes de la licence Creative Commons CC0 Don universel au domaine public. | |
La personne qui a associé une œuvre avec cet acte l’a placée dans le domaine public en renonçant mondialement à tous ses droits sur cette œuvre en vertu des lois relatives au droit d’auteur, ainsi qu’à tous les droits juridiques connexes et voisins qu’elle possédait sur l’œuvre, sans autre limite que celles imposées par la loi. Vous pouvez copier, modifier, distribuer et utiliser cette œuvre, y compris à des fins commerciales, sans qu’il soit nécessaire d’en demander la permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
Éléments décrits dans ce fichier
dépeint
Valeur sans élément de Wikidata
9 mai 2011
image/svg+xml
31cfb22bd2b6ebd79849d3d8a0f44e93c16c64af
2 285 771 octet
231 pixel
506 pixel
Historique du fichier
Cliquer sur une date et heure pour voir le fichier tel qu'il était à ce moment-là.
Date et heure | Vignette | Dimensions | Utilisateur | Commentaire | |
---|---|---|---|---|---|
actuel | 10 mai 2011 à 08:00 | 506 × 231 (2,18 Mio) | DenisBoigelot | {{Information |Description ={{en|1=fd}} |Source ={{own}} |Author =DenisBoigelot |Date = |Permission = |other_versions = }} fjdk |
Utilisation du fichier
La page suivante utilise ce fichier :
Usage global du fichier
Les autres wikis suivants utilisent ce fichier :
- Utilisation sur ast.wikipedia.org
- Utilisation sur as.wikipedia.org
- Utilisation sur be.wikipedia.org
- Utilisation sur bn.wikipedia.org
- Utilisation sur bs.wikipedia.org
- Utilisation sur ca.wikipedia.org
- Utilisation sur cs.wikipedia.org
- Utilisation sur el.wikipedia.org
- Utilisation sur en.wikipedia.org
- Utilisation sur en.wikiversity.org
- Utilisation sur en.wiktionary.org
- Utilisation sur es.wikipedia.org
- Utilisation sur fa.wikipedia.org
- Utilisation sur fi.wikipedia.org
- Utilisation sur fi.wiktionary.org
- Utilisation sur ga.wikipedia.org
- Utilisation sur ja.wikipedia.org
- Utilisation sur jv.wikipedia.org
- Utilisation sur ko.wikipedia.org
- Utilisation sur pt.wikipedia.org
- Utilisation sur ru.wikipedia.org
- Utilisation sur sl.wikipedia.org
- Utilisation sur sr.wikipedia.org
- Utilisation sur sv.wikipedia.org
- Utilisation sur tl.wikipedia.org
- Utilisation sur uk.wikipedia.org
- Utilisation sur www.wikidata.org
- Utilisation sur zh-yue.wikipedia.org
- Utilisation sur zh.wikipedia.org
Métadonnées
Ce fichier contient des informations supplémentaires, probablement ajoutées par l'appareil photo numérique ou le numériseur utilisé pour le créer.
Si le fichier a été modifié depuis son état original, certains détails peuvent ne pas refléter entièrement l'image modifiée.
Titre court | R SVG Plot |
---|---|
Titre de l’image | R SVG Plot with tooltips! (mode=1) |