[R] How to simulate heteroscedasticity (correlation)

From: Jörg Groß <joerg_at_licht-malerei.de>
Date: Tue, 22 Jul 2008 20:59:00 +0200


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?



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Jul 2008 - 19:17:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 10:32:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive