On 04/27/2013 11:32 PM, triutami....@gmail.com wrote:
Dear Sir,
Yes, I want to generate the data by two Gaussian but mean from one of them 
generatated from polar its coordinates. I am confused about the algorithm? I know 
how to generate two Gaussian data with certain mean&covariance matrix using 
mvnorm but what about mean from its polar coordinates?
Thanks for your help.

Hi Iut,
If you mean transforming a normal (Gaussian) variate into polar coordinates, it is not too hard:

polar.norm<-180+rnorm(100,0,10)

You can alter the "mean" point by changing the constant value and the extent to which the tails wrap around the circles with the third argument to "rnorm". Be aware that large negative and positive values will "wrap around" to the polar values of the opposite sign depending upon the variance of the normal variate.

Jim

______________________________________________
R-help@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.

Reply via email to