similar to: Question on where samples are grouped in rmvnorm{mvtnorm}

Displaying 20 results from an estimated 300 matches similar to: "Question on where samples are grouped in rmvnorm{mvtnorm}"

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
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
2009 Oct 07
1
inconsistency in return value of peaks() {splus2R} (PR#13988)
Full_Name: Benny van der Vijgh Version: 2.7.2 OS: Windows Vista Submission from: (NULL) (194.171.252.108) The return value of peaks() in package splus2R is not consistent. This is because of the call to max.col() without additional parameters which peaks() makes. max.col() has a parameter 'ties.method' which specifies how ties are handled, with "random" by default. This means
2008 May 30
2
scoping problem when calling lm(precomputed formula, weights) from function (PR#11540)
I've run into a scoping problem in R. I'm calling a function that * creates a formula * calculates a weight vector * calls lm with that formula and weights This fails. Here's a simplified reproduce example: # f works, g doesn't, h is a workaround rm(w) data <- data.frame(y=runif(20), x=runif(20), z=runif(20)) f <- function(k){ w <- data$z^k coef(lm(y~x, data
2008 May 29
1
help (using ?) does not handle trailing whitespace (PR#11537)
> ?agrep > Results in: No documentation for 'agrep ' in specified packages and libraries: you could try 'help.search("agrep ")' There is white space after agrep, that ? doesn't ignore. --please do not edit the information below-- Version: platform = i486-pc-linux-gnu arch = i486 os = linux-gnu system = i486, linux-gnu status = major = 2 minor =
2008 Aug 22
1
save() should not overwrite a file if an error occurs (PR#12583)
If save() fails because an object is not found, it should not overwrite an existing file. > a <- 1:9 > save(a, file = "a.rda") > rm(a) > load("a.rda") > a [1] 1 2 3 4 5 6 7 8 9 > rm(a) > save(a, file = "a.rda") Error in save(a, file = "a.rda") : object 'a' not found > load("a.rda") Error in
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
2008 Aug 18
2
ifelse
I find it slightly surprising, that ifelse(TRUE, character(0), "") returns NA instead of character(0). [WNT 2.6.2 Patched] -- Heikki Kaskelma
2006 Nov 30
1
data.frame within a function (PR#9294) (cont'd)
This continues the message "data.frame within a function (PR#9294)" that was posted on 2006/10/12. Duncan Murdoch kindly replied. I'm using the current version R 2.4.0, but the same issue exists. Just copy and paste the following code under R, and compare the output of f1() and f2() and the output of f3() and f4(). Does anybody have any idea? Thanks.
2008 Aug 11
2
generating a random signal with a known correlation
Hi, How can I generate a random signal that's correlated with a given signal at a given correlation (say 0.7)? I've been looking at rmvnorm etc but don't seem to figure it out. Thanks ----- Yasir H. Kaheil Columbia University -- View this message in context: http://www.nabble.com/generating-a-random-signal-with-a-known-correlation-tp18932541p18932541.html Sent from the R help
2012 Aug 11
3
Problem when creating matrix of values based on covariance matrix
Hi, I want to simulate a data set with similar covariance structure as my observed data, and have calculated a covariance matrix (dimensions 8368*8368). So far I've tried two approaches to simulating data: rmvnorm from the mvtnorm package, and by using the Cholesky decomposition (http://www.cerebralmastication.com/2010/09/cholesk-post-on-correlated-random-normal-generation/). The problem is
2006 Jul 01
5
generate bi-variate normal data
Dear all, I would like to generate bi-variate normal data given that the first column of the data is known. for example: I first generate a set of data using the command, x <- rmvnorm(10, c(0, 0), matrix(c(1, 0, 0, 1), 2)) then I would like to sum up the two columns of x: x.sum <- apply(x, 1, sum) now with x.sum I would like to generate another column of data, say y, that makes
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
2008 Oct 22
3
Help finding the proper function
This might not be the correct forum for this question for there might be some flaws in my logic so the R function I'm looking for might not be the correct, but I know there?s a lot of smart people in this forum so please correct me if I'm wrong. I have been googling and searching in this forum for something useful but so far I'm out of luck. This is the background to my problem. I
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]]
2010 Mar 17
2
How to use "ifelse" to generate random value from a distribution
I need use different parameters of distribution for different case to generate random value, but I use ifelse, the generated value is fixed without change. Here is example data1 y x 1 1 2 2 2 1 3 3 2 4 4 3 5 5 3 6 6 1 7 7 2 8 8 1 9 9 1 10 10 3 11 11 3 12 12 2 ifelse(data1$x==1,rnorm(1,2,1),ifelse(data1$x==2,rnorm(1,-2,1),rnorm(1,110,1))) [1] -1.8042172 0.8478681
2002 Oct 02
4
T-Distribution
Dear sir, I would ask if there are in R some code to generate a random sample from a mvariate student distribution like that one wich generate the multivariate normal one i mean( rmvnorm(n, mu, sigma) Second question : if R can plot density 3Dcurve I don't mean de histogram but de hole density function(normal for example). I use a windows version of The R software Thank you in advance wiyh
2011 Sep 03
1
Bootstrapping a covariance matrix
Dear all I am a bit new to R so please keep your swords sheathed! I would simply like to bootstrap a covariance matrix from a multivariate gaussian density. At face value that seemed like a very straightforward problem to solve but I somehow could not get the boot package to work and did not really understand the documentation so I tried to do the bootstrap manually. Hence: x<-rmvnorm(n = 5,
2010 May 10
1
Random walk
Hi everybody, I am trying to generate two random walks with an specific correlation, for example, two random walks of 200 time steps with a correlation 0.7. I built the random walks with: x<-cumsum(rnorm(200, mean=0,sd=1)) y<-cumsum(rnorm(200, mean=0,sd=1)) but I don't know how to fix the correlation between them. With white noise is easy to fix the correlation using the function