Displaying 20 results from an estimated 30000 matches similar to: "Simulation in R"
2009 May 18
2
Simulation from a multivariate normal distribution
I must to create an array with dimensions 120x8x500. Better I have to make 500 simulations of 8 series of return from a multivariate
normal distribution. there's the command "mvrnorm" but how I can do this repeating the simulation 500 times?"
[[alternative HTML version deleted]]
2007 Dec 17
2
regression towards the mean, AS paper November 2007
Dear friends, regression towards the mean is interesting in medical
circles, and a very recent paper (The American Statistician November
2007;61:302-307 by Krause and Pinheiro) treats it at length. An initial
example specifies (p 303):
"Consider the following example: we draw 100 samples from a bivariate
Normal distribution with X0~N(0,1), X1~N(0,1) and cov(X0,X1)=0.7, We
then calculate
2005 Jan 18
4
Data Simulation in R
Dear List:
A few weeks ago I posted some questions regarding data simulation and
received some very helpful comments, thank you. I have modified my code
accordingly and have made some progress.
However, I now am facing a new challenge along similar lines. I am
attempting to simulate 250 datasets and then run the data through a
linear model. I use rm() and gc() as I move along to clean up the
2011 May 16
3
Simulating correlations with varying sample sizes
Hi there,
I would like to draw 10 correlations from a bivariate population - but every
draw should be done with a different sample size. I thought I could to this
with a loop:
r=numeric(10) #Goal vector
N = c(1000,100,80,250,125,375,90,211,160,540) #Sample size vector
for(i in 1:10) {
data <- mvrnorm(n=N,mu=c(0,0),Sigma=matrix(c(1,.3,.3,1),2))
r[i] <- cor(data[,1],data[,2])
}
2013 Feb 20
2
Why R simulation gives same random results?
Hi, list
I am doing 100,000 iterations of Bayesian simulations.
What I did is I split it into 4 different R sessions, each one runs 25,000
iteration. But two of the sessions gave the simulation result.
I did not use any set.seed(). What is going on here?
Thanks,
Mike
[[alternative HTML version deleted]]
2005 Mar 24
2
Bivariate lognormal distribution
Dear experts!
Is there a package that enables to create the bivariate log-normal variables?
Thanks a lot,
Vicky Landsman.
[[alternative HTML version deleted]]
2002 Jan 23
6
multivariate simulation
To whom it may concern,
I try to simulate a non-normal multivariate distribution. The MASS package
allows by mean of "mvrnorm" command to perform a multivariate normal
simulation. Is there an equivalent command for an arbitrary multivariate
distribution available in the R-language?
Thank you in advance.
Bernard Colin
Colin Bernard
Professeur titulaire
D?partement de Math?matiques et
2012 Mar 23
1
Nonparametric bivariate distribution estimation and sampling
Dear all,
I have a bivariate dataset from a preliminary study. I want to do two things: (1) estimate the probability density of this bivariate distribution using some nonparametric method (kernel, spline etc); (2) sample a big dataset from this bivariate distribution for a simulation study.
Is there any good method or package I can use in R for my work? I don?t want parametric models like
2000 Apr 05
1
simulation from a bivariate normal distribution
Hi,
I need to generate two normal variables with covariance matrix:
0.25, 0.20
0.20, 0.25
but I have no idea how to do that.
Can anyone help me?
Thanks,
Joaquim
----------------------------------------------------------------------------
----------
Joaquim J. S. Ramalho
University of Bristol
Department of Economics
8 Woodland Road
Bristol BS8 1TN
United Kingdom
2008 Oct 04
3
How to plot countours with fixted densities?
Hello,
I used the following codes to generate bivariate normal dependence structure with unit Frechet margins.
Sigma <- matrix(c(1,.5*sqrt(1),.5*sqrt(1),1),2,2) # generate
y <- mvrnorm(Nsam, c(0,0), Sigma) # random
v <- cbind(pnorm(y[,1],mean = 0, sd = 1), pnorm(y[,2],mean = 0, sd = 1))
z <- cbind(-1/log(v[,1]),-1/log(v[,2]))
z1 <- z[,1]
z2 <- z[,2]
And to
2008 May 09
1
Multivariate simulation
Dear everyone, I am having problem simulating multivariate data. Though I was able to simulate the data, but finding the variance-covariance matrix of simulated data did not give exact covariance matrix used in simulating the data. Unlike some other packages, like stata, using command "corr2data" will simulate data having the covariance matrix exactly with the specified covariance
2012 Oct 26
3
how to make simulation faster
Dear R users,
I need to run 1000 simulations to find maximum likelihood estimates. I
print my output as a vector. However, it is taking too long. I am running 50
simulations at a time and it is taking me 30 minutes. Once I tried to run
200 simulations at once, after 2 hours I stopped it and saw that only about
40 of them are simulated in those 2 hours. Is there any way to make my
simulations
2008 Jul 22
2
F test
Dear R users,
I need to do a F test on the hypothesis that a 2 by 1 vector (X_1, X_2)' has the mean vector (M_1, M_2)'. Specifically, I would like to assume the X vector comes from a bivariate Normal distribution (M, Sigma). Then, given 1000 observations on X, I wanted to test if the means of X agree with the means of the target Normal distribution. Any function or package in R could do
2009 Jan 26
1
generic questions about probability and simulation -- not directly related to R
Dear helpers,
As the title says, my question is not directly related to R.
I find, however, that there are many people who are both knowledgeable and
kind in this email list, and so decided to give it a try.
I do stochastic simulations. Parameter values used in simulation often come
from the observations of the real word phenomena.
Parameter values are often given as "rates" (of
2005 Sep 22
7
Automatic creation of file names
Dear R-Help members,
I have a question about how to save to the hard drive the one thousand
datasets I generated in a simulation. The datasets are created in a
"for" loop that repeatedly creates normally distributed datasets, such
as the example below:
Library(MASS)
for (number in 1:1000) {
dataset = mvrnorm(n = 400, mu = c(0,0,0),
Sigma =
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 Mar 01
2
Simulation
I tried looking for help but I couldn't locate the exact solution.
I have data that has several variables. I want to do several sample
simulations using only two of the variables (eg: say you have data between
people and properties owned. You only want to check how many in the samples
will come up with bicycles) to estimate probabilities and that sort of
thing.
Now, I can only do a simulation
2002 Jan 24
1
Simulation of a particular type of population
Does anyone have any R code or suggestions on how to generate a population
that follows a Neyman-Scott process? More specifically, I'd like to
randomly generate both the parents and the children from Poisson
distributions and the children locations from a bivariate normal onto an
N by N grid. If the locations spill over outside the grid, then I'd like
to reflect those locations back into
2008 Nov 11
1
simulate data with binary outcome and correlated predictors
Hi,
I would like to simulate data with a binary outcome and a set of predictors that are correlated. I want to be able to fix the number of event (Y=1) vs. non-event (Y=0). Thus, I fix this and then simulate the predictors. I have 2 questions:
1. When the predictors are continuous, I can use mvrnorm(). However, if I have continuous, ordinal and binary predictors, I'm not sure how to simulate
2012 Oct 12
1
better example for multivariate data simulation question-please help if you can
Dear?All,
?
a few weeks ago I have posted a question on the R help listserv that?some of you have responded to with a great solution, would like to thank you for that? again.?I thought I would reach out to you with the issue I am trying to solve now. I have posted the question a few days ago, but probably it was not?clear enough, so I thought i try it again.?At times I have a multivariate example