similar to: Simulating from a Multivariate Normal Distribution Using a Correlation Matrix

Displaying 20 results from an estimated 3000 matches similar to: "Simulating from a Multivariate Normal Distribution Using a Correlation Matrix"

2010 Aug 24
3
generate random numbers from a multivariate distribution with specified correlation matrix
Hi all, rmvnorm()can be used to generate the random numbers from a multivariate normal distribution with specified means and covariance matrix, but i want to specify the correlation matrix instead of covariance matrix for the multivariate normal distribution. Does anybody know how to generate the random numbers from a multivariate normal distribution with specified correlation matrix? What about
2007 Feb 13
4
Generating MVN Data
Dear All I want to generate multivariate normal data in R for a given covariance matrix, i.e. my generated data must have the given covariance matrix. I know the rmvnorm command is to be used but may be I am failing to properly assign the covariance matrix. Any help will be greatly appreciated thanks. M. R. Ahmad
2007 Aug 13
1
simulate data from multivariate normal with pre-specified correlation matrix
For example, the correlation matrix is 3x3 and looks like 1 0.75 0 0 0 0.75 1 0 0 0 0 0 0 0 0 Can I write the code like this? p<- 3 # number of variables per observation N<- 10 # number of samples # define population correlation matrix sigma sigma<-matrix(0,p,p) #creates a px p matrix of 0 rank<-2 for (i in 1:rank){ for (j in 1:rank){ rho<-0.75
2012 Sep 27
2
Generating an autocorrelated binary variable
Hi R-fellows, I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable should be 0.5. Below you can see the R code (I use for simplicity a diagonal matrix in rmvnorm even if it
2018 Apr 12
3
Bivariate Normal Distribution Plots
R-Help I am attempting to create a series of bivariate normal distributions. So using the mvtnorm library I have created the following code ... # Standard deviations and correlation sig_x <- 1 sig_y <- 1 rho_xy <- 0.0 # Covariance between X and Y sig_xy <- rho_xy * sig_x *sig_y # Covariance matrix Sigma_xy <- matrix(c(sig_x ^ 2, sig_xy, sig_xy, sig_y ^ 2), nrow = 2, ncol = 2)
2007 Jan 06
1
help with gls
Hello R-users, I am using gls function in R to fit a model with certain correlation structure. The medol as: fit.a<-gls(y~1,data=test.data,correlation=corAR1(form=~1|aa),method="ML") mu<-summary(fit.a)$coefficient With the toy data I made to test, the estimate of mu is exactly equal to the overall mean of y which can not be true. But, if I make a toy data with y more than two
2005 Dec 15
5
How to simulate correlated data
Hello there, I would like to simulate X --Normal (20, 5) Y-- Normal (40, 10) and the correlation between X and Y is 0.6. How do I do it in R? Thank you very much Lisa Wang Msc. Princess Margaret Hospital Toronto, Ca
2018 Mar 03
2
lmrob gives NA coefficients
Dear list members, I want to perform an MM-regression. This seems an easy task using the function lmrob(), however, this function provides me with NA coefficients. My data generating process is as follows: rho <- 0.15 # low interdependency Sigma <- matrix(rho, d, d); diag(Sigma) <- 1 x.clean <- mvrnorm(n, rep(0,d), Sigma) beta <- c(1.0, 2.0, 3.0, 4.0) error <- rnorm(n = n,
2018 Mar 04
2
lmrob gives NA coefficients
Thanks for your reply. I use mvrnorm from the *MASS* package and lmrob from the *robustbase* package. To further explain my data generating process, the idea is as follows. The explanatory variables are generated my a multivariate normal distribution where the covariance matrix of the variables is defined by Sigma in my code, with ones on the diagonal and rho = 0.15 on the non-diagonal. Then y
2018 Mar 04
0
lmrob gives NA coefficients
What is 'd'? What is 'n'? On Sun, Mar 4, 2018 at 12:14 PM, Christien Kerbert < christienkerbert at gmail.com> wrote: > Thanks for your reply. > > I use mvrnorm from the *MASS* package and lmrob from the *robustbase* > package. > > To further explain my data generating process, the idea is as follows. The > explanatory variables are generated my a
2007 May 26
1
Why ?rmvnorm not working
Hi, My R version is 2.4.1 and I installed the the packages MASS and run command library("MASS"), however when I type ?rmvnorm, no help topic found, it worked before. I tried to ype ?rinvgamma from "MCMCpack" which works great. Anybody have idea? I also reinstalled MASS package, but when I try to type rmvnorm(), no functions found. Pat
2018 Mar 03
0
lmrob gives NA coefficients
> On Mar 3, 2018, at 3:04 PM, Christien Kerbert <christienkerbert at gmail.com> wrote: > > Dear list members, > > I want to perform an MM-regression. This seems an easy task using the > function lmrob(), however, this function provides me with NA coefficients. > My data generating process is as follows: > > rho <- 0.15 # low interdependency > Sigma <-
2003 Feb 15
2
(no subject)
Hi, Are there some packages which can generate multi-normal, multi-t, etc multivariate sampling? thanks! Best wishes, Peng ******************************* Peng Zhang Department of Biostatistics Harvard School of Public Health 655 Huntington Avenue Boston, Massachusetts 02115 ******************************* I believe I can fly I believe I can touch the sky
2004 May 04
2
Sampling 1000 times from a bivariate normal distibution
Dear expert, I have two coefficients and covariance matrix. My objective is sampling 1000 times from the mean and covariance matrix. In order to get that, what kind of commend should I use? If you do not mind, could you tell me the comment in detail about parameter used in that commend also? Thank you. Sung. [[alternative HTML version deleted]]
2005 Jan 13
1
how to use solve.QP
At the risk of ridicule for my deficient linear algebra skills, I ask for help using the solve.QP function to do portfolio optimization. I am trying to following a textbook example and need help converting the problem into the format required by solve.QP. Below is my sample code if anyone is willing to go through it. This problem will not solve because it is not set up properly. I hope I
2004 Feb 02
3
mvrnorm problem
I am trying to simulate draws from a multivariate normal using mvrnorm, and am getting the following error message: Error in mu + eS$vectors %*% diag(sqrt(pmax(ev, 0)), p) %*% t(X) : non-conformable arrays I do not understand why I am getting this message, since the vector of means I am giving to the function is 13 by 1 and the variance matrix I am giving to the function is 13
2003 May 06
4
Questons about R capabilities
Hello, 1) I am interested in performing a limited-dependent variable linear regression. By this I mean a classical linear regression, but for the case where the values of the dependent variable cannot vary from -infinity to +infinity, but are truncated and so are between two finite limits L1 and L2. Does R1.7 have this capability? If so what is (are) the relevant command(s)? 2) I am also
2018 Mar 04
1
lmrob gives NA coefficients
d is the number of observed variables (d = 3 in this example). n is the number of observations. 2018-03-04 11:30 GMT+01:00 Eric Berger <ericjberger at gmail.com>: > What is 'd'? What is 'n'? > > > On Sun, Mar 4, 2018 at 12:14 PM, Christien Kerbert < > christienkerbert at gmail.com> wrote: > >> Thanks for your reply. >> >> I use
2011 Aug 05
1
Simulacion matrices de varianza-covarianza
Hola! Para simular matrices de datos normales multivariados con la sentencia rmvnorm (dentro del paquete mvtnorm) se necesita, entre otras cosas, el número de vectores a simular, el vector de parámetros-medias correspondiente a cada variable y su respectiva matriz de Varianza-Covarianza. En este último punto, tengo problemas. En lugar de ingresar una matriz sigma creada por mi, necesito simular
2010 Feb 11
1
histogam plots
Hi all, I want to draw a histgram for each row of a matrix and compare them. However the plot I got does not have the same y range and x range, which makes it difficult to make the comparison. Is there a easy way to fix the x range and y range in a xy plot for several plots, instead of specifying them for each plot. The following is my code for generalizing the matrix and draw the histogram.