similar to: mvrnorm problem

Displaying 7 results from an estimated 7 matches similar to: "mvrnorm problem"

2011 Aug 24
0
How to use mvrnorm?
Dear R community! I would like to simulate distributions based on a polynomial model. It consists of 96 values and I want to randomly select new normaly distributed values around the modeled values. Furthermore, each value should be correlated with the previous one. Is it correct to therefore use mvrnorm? How do I define sigma? Thank you very much for your help. All the best, Marianne -- View
2011 Jul 06
1
Create simulated data's using mvrnorm
Hi All This might be something very trivial but I seem to miss something in the syntax or logic which makes me keep wandering around the problem without arriving at a solution. What I want to do is to simulate a sample data for performing cluster analysis. I tried to use x1= mvrnorm(10,rep(0.8,3),diag(3)) x2= mvrnorm(10,rep(0,3),diag(3)) x3= mvrnorm(10,rep(-0.5,3),diag(3)) x=rbind(x1,x2,x3)
2012 Jun 10
2
mvrnorm limits
Dear All,   I am using the following commands to generate a given dataset:   a <-c(0.348,0.007,0.503,0.58,0.21) cov <-c(0.0448,0,0,0,0,0.0001,0.0001,0,0,0,-0.0055,-0.0005,0.0495,0,0,0.0218,0.0009,-0.0253,0.1103,0,-0.0102,-0.0007,0.00631,0.0067,0.0132) b <-matrix(cov,nrow=5, ncol = 5, byrow = TRUE,dimnames = NULL) g <-mvrnorm(10000,a,b)   is there a way to place limits on the simulated
2011 Jan 22
1
faster mvrnorm alternative
Hello, does anybody know another faster function for random multivariate normal variable simulation? I'm using mvrnorm, but as profiling shows, my algorithm spends approximately 50 % in executing mvrnorm function. Maybe some of you knows much faster function for multivariate normal simulation? I would be very gratefull for advices. -- View this message in context:
2011 May 07
1
generate multiple mvrnorm samples using apply-like
I want to generate multiple multivariate normal samples with different mean vectors and common covariance matrix. I can do this with a loop, but can't quite figure out how to do it with apply and friends. In the example below, I want values to have 3 columns: group, x, y # number of groups, and group means x <- jitter(seq(2,10,by=2)) y <- x + rnorm(length(x), 0, .5) means <-
2005 May 01
2
eigen() may fail for some symmetric matrices, affects mvrnorm()
Hi all, Recently our statistics students noticed that their Gibbs samplers were crashing due to some NaNs in some parameters. The NaNs came from mvrnorm (Ripley & Venables' MASS package multivariate normal sampling function) and with some more investigation it turned out that they were generated by function eigen, the eigenvalue computing function. The problem did not seem to happen
2005 Jan 06
2
Generating Data mvrnorm and loops
Dear List: I am generating N datasets using the following Sigma<-matrix(c(400,80,80,80,80,400,80,80,80,80,400,80,80,80,80,400),4,4 ) mu<-c(100,150,200,250) N=100 for(i in 1:N) { assign(paste("Data.", i, sep=''), as.data.frame(cbind(seq(1:1000),(mvrnorm(n=1000, mu, Sigma))))) } With these datasets, I need to work on some of the variables and then run each dataset