[R] How to simulate heteroscedasticity (correlation)

Jörg Groß joerg at licht-malerei.de
Tue Jul 22 20:59:00 CEST 2008


Hi,

I would like to generate two correlated variables.

I found that funktion for doing that:
a <- rmvnorm(n=10000,mean=c(20,20),sigma=matrix(c(5,0.8*sqrt(50),  
0.8*sqrt(50),10),2,2))
(using library(mvtnorm))

Now I also want to generate two correlated variables where the error  
variance vary over the variable-correlation.
And I want to plot this for showing heteroscedasticity.

Like shown here:
http://upload.wikimedia.org/wikipedia/de/1/1b/Heteroske2.png

Is that possible with R?



More information about the R-help mailing list