Displaying 20 results from an estimated 500 matches similar to: "Generating an autocorrelated binary variable"
2011 May 01
2
Question on where samples are grouped in rmvnorm{mvtnorm}
Dear All,
For function: rmvnorm{mvtnorm} in (library mvtnorm, not splus2R), if I generate 2 bivariate normal samples as follows:
> rmvnorm(2,mean=rep(0,2),sigma=diag(2))
[,1] [,2]
[1,] 2.0749459 1.4932752
[2,] -0.9886333 0.3832266
Where is the first sample, it is stored in the first row or the first column?
Does this function store samples row-wise or column-wise?
Thank
2012 Jul 04
2
How to generate a correlated binary data set?
Hi.
I am trying to generate a correlated binary data set.
I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none
of them works in R version 2.15.1.
Do you know any package to generate correlated binary covariates and work
in R version 2.15.1, or how to generate it?
Thanks,
[[alternative HTML version deleted]]
2011 Aug 27
3
Exception while using NeweyWest function with doMC
Dear R users,
I am using R right now for a simulation of a model that needs a lot of
memory. Therefore I use the *bigmemory* package and - to make it faster -
the *doMC* package. See my code posted on http://pastebin.com/dFRGdNrG
Now, if I use the foreach loop with the addon %do% (for sequential run) I
have no problems at all - only here and there some singularities in
regressor matrices which
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
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.
2013 Feb 01
2
Armadillo error in R extension
Is there anyway with some experience in using armadillo in R C++ extensions?
My problem is the following:
I programmed a function in a header looking like
#include <armadillo>
inline arma::vec foo(input) {
... do something
return an arma::vec object
}
compiling this via R CMD INSTALL packagename (PKG_CXXFLAGS = -I/folder/of/armadillo and armadillo_bits in my package)
I get the
2013 Oct 28
3
speed of makeCluster (package parallel)
Hi all,
I am quite new in the world of parallelization and I wonder if there is a
way to increase the speed of creation of a parallel socket cluster. The
time spend to include threads increase exponentially with the number of
thread considered and I use of computer with two 8 cores CPU and thus
showing a total of 32 threads in windows 7.
Currently, I use the default parameters (type =
2013 Jan 31
5
Modify objects in function
Dear R community,
I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think a little harder on implementation style (especially to spare users complex object handling).
I have a function foo(), taking as input arguments two S4 objects of different class
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
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
2013 Feb 26
2
Count function calls
Dear R-users,
I have the following problem: I am running the function 'pvcm' from the 'plm' Panel Data package. Inside this function 'solve' is called and gives for a certain individual data series an exception because of singularity. I would like to know which individual data series causes this error. I tried to debug it, but this is truly painful, as solve is called
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
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
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 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
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
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
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
2013 Mar 05
3
Simulate binary correlated data
Dear R experts,
I am trying to simulate correlated binary data and have stumbled upon the
following problem:
With the help of "binarySimCLF" or "mvpBinaryEp" I have been able to
simulate correlating binary vectors given certain mean values and a desired
correlation. My problem is that these procedures do not allow you to specify
the exact vector for which you want to generate