[R] simulation

2007-10-16 Thread Oarabile Molaodi
I am trying to write a function that will simulate observed counts X and Y as below, I want the function to be able give many replicates, can somebody advise? thanks Oarabile #alpha,n sdx and sdy are constant, and N is a vector of length n. unstructured<-function(n,N,alpha,sdx,sdy){ Vx<-rnorm(n

[R] Simulation

2009-05-13 Thread Debbie Zhang
Dear R users, Can anyone please tell me how to generate a large number of samples in R, given certain distribution and size. For example, if I want to generate 1000 samples of size n=100, with a N(0,1) distribution, how should I proceed? (Since I dont want to do "rnorm(100,0,1)" in R for 10

[R] Simulation

2009-05-15 Thread Kon Knafelman
hey guys, i've been following this discussion about the simulation, and being a beginner myself, im really unsure of the best method. I hve the same problem as the initial one, except i need 1000 samples of size 15, and my distribution is Exp(1). I've adjusted some of the loop formulas for

Re: [R] simulation

2007-10-16 Thread Sandrine-et-Francois
sday, October 16, 2007 11:47 AM Subject: [R] simulation >I am trying to write a function that will simulate observed counts X and > Y as below, I want the function to be able give many replicates, can > somebody advise? > thanks > Oarabile > > #alpha,n sdx and sdy are con

Re: [R] Simulation

2009-05-13 Thread Gábor Csárdi
On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang wrote: > > > Dear R users, > > Can anyone please tell me how to generate a large number of samples in R, > given certain distribution and size. > > For example, if I want to generate 1000 samples of size n=100, with a N(0,1) > distribution, how shoul

Re: [R] Simulation

2009-05-13 Thread Dimitris Rizopoulos
what about putting in a matrix, e.g., matrix(rnorm(1000*100), 1000, 100) I hope it helps. Best, Dimitris Debbie Zhang wrote: Dear R users, Can anyone please tell me how to generate a large number of samples in R, given certain distribution and size. For example, if I want to generate 10

Re: [R] Simulation

2009-05-13 Thread Mike Lawrence
If you want k samples of size n, why generate k*n samples and put them in a k-by-n matrix where you can do what you want to each sample: k = 10 n = 100 x=matrix(rnorm(k*n),k,n) rowMeans(x) If you need to do more complex things to each sample and if k is large enough that you don't want the matrix

Re: [R] Simulation

2009-05-13 Thread Barry Rowlingson
On Wed, May 13, 2009 at 4:26 PM, Gábor Csárdi wrote: > On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang wrote: >> >> >> Dear R users, >> >> Can anyone please tell me how to generate a large number of samples in R, >> given certain distribution and size. >> >> For example, if I want to generate 1000

Re: [R] Simulation

2009-05-13 Thread Jorge Ivan Velez
Dear Debbie, Here are two options: # Parameters N <- 1000 n <- 100 # Option 1 mys <- replicate(N, rnorm(n)) mys # Option 2 mys2 <- matrix(rnorm(N*n),ncol=N) mys2 HTH, Jorge On Wed, May 13, 2009 at 11:13 AM, Debbie Zhang wrote: > > > Dear R users, > > Can anyone please tell me how to generat

Re: [R] Simulation

2009-05-13 Thread Linlin Yan
Does every 100 numbers in rnorm(100 * 1000, 0, 1) have the N(0,1) distribution? On Wed, May 13, 2009 at 11:13 PM, Debbie Zhang wrote: > > > Dear R users, > > Can anyone please tell me how to generate a large number of samples in R, > given certain distribution and size. > > For example, if I wan

Re: [R] Simulation

2009-05-13 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: > On Wed, May 13, 2009 at 4:26 PM, Gábor Csárdi wrote: > >> On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang wrote: >> >>> Dear R users, >>> >>> Can anyone please tell me how to generate a large number of samples in R, >>> given certain distribution and size. >>> >>>

Re: [R] Simulation

2009-05-13 Thread Barry Rowlingson
On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk wrote: > Barry Rowlingson wrote: >>  Soln - "for" loop: >> >>  > z=list() >>  > for(i in 1:1000){z[[i]]=rnorm(100,0,1)} >> >> now inspect the individual bits: >> >>  > hist(z[[1]]) >>  > hist(z[[545]]) >> >> If that's the problem, then I suggest

Re: [R] Simulation

2009-05-13 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: > On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk > wrote: >> Barry Rowlingson wrote: > >>> Soln - "for" loop: >>> >>> > z=list() >>> > for(i in 1:1000){z[[i]]=rnorm(100,0,1)} >>> >>> now inspect the individual bits: >>> >>> > hist(z[[1]]) >>> > hist(z[[545]]) >>> >

Re: [R] Simulation

2009-05-13 Thread Carl Witthoft
So far nobody seems to have warned the OP about seeding. Presumably Debbie wants 1000 different sets of samples, but as we all know there are ways to get the same sequence (initial seed) every time. If there's a starting seed for one of the "generate a single giant matrix" methods proposed, t

Re: [R] Simulation

2009-05-13 Thread Barry Rowlingson
On Wed, May 13, 2009 at 9:56 PM, Wacek Kusnierczyk wrote: > Barry Rowlingson wrote: >    n = 1000 >    benchmark(columns=c('test', 'elapsed'), order=NULL, >       'for'={ l = list(); for (i in 1:n) l[[i]] = rnorm(i, 0, 1) }, >       lapply=lapply(1:n, rnorm, 0, 1) ) >    #     test elapsed >    #

Re: [R] Simulation

2009-05-13 Thread Rolf Turner
On 14/05/2009, at 10:04 AM, Carl Witthoft wrote: So far nobody seems to have warned the OP about seeding. Presumably Debbie wants 1000 different sets of samples, but as we all know there are ways to get the same sequence (initial seed) every time. If there's a starting seed for one of the

Re: [R] Simulation

2009-05-13 Thread Dimitris Rizopoulos
Wacek Kusnierczyk wrote: Barry Rowlingson wrote: On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk wrote: Barry Rowlingson wrote: Soln - "for" loop: > z=list() > for(i in 1:1000){z[[i]]=rnorm(100,0,1)} now inspect the individual bits: > hist(z[[1]]) > hist(z[[545]]) If that's the pr

Re: [R] Simulation

2009-05-13 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: > On Wed, May 13, 2009 at 9:56 PM, Wacek Kusnierczyk > wrote: > >> Barry Rowlingson wrote: >> > > >>n = 1000 >>benchmark(columns=c('test', 'elapsed'), order=NULL, >> 'for'={ l = list(); for (i in 1:n) l[[i]] = rnorm(i, 0, 1) }, >> lapply=lappl

Re: [R] Simulation

2009-05-13 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: [...] >>> Yes, you can probably vectorize this with lapply or something, but I >>> prefer clarity over concision when dealing with beginners... >>> >> but where's the preferred clarity in the for loop solution? >> > > Seriously? You think: > > lapply(1:n, rno

Re: [R] Simulation

2009-05-14 Thread Wacek Kusnierczyk
Dimitris Rizopoulos wrote: > Wacek Kusnierczyk wrote: >> Barry Rowlingson wrote: >>> On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk >>> wrote: Barry Rowlingson wrote: > Soln - "for" loop: > > > z=list() > > for(i in 1:1000){z[[i]]=rnorm(100,0,1)} > > now inspect

Re: [R] Simulation

2009-05-14 Thread Peter Flom
Wacek Kusnierczyk wrote >> Seriously? You think: >> >> lapply(1:n, rnorm, 0, 1) >> >> is 'clearer' than: >> >> x=list() >> for(i in 1:n){ >> x[[i]]=rnorm(i,0,1) >> } >> >> for beginners? >> >> Firstly, using 'lapply' introduces a function (lapply) that doesn't >> have an intuitive name. Also,

Re: [R] Simulation

2009-05-14 Thread Wacek Kusnierczyk
Peter Flom wrote: > >>> Seriously? You think: >>> >>> lapply(1:n, rnorm, 0, 1) >>> >>> is 'clearer' than: >>> >>> x=list() >>> for(i in 1:n){ >>> x[[i]]=rnorm(i,0,1) >>> } >>> >>> for beginners? >>> >>> Firstly, using 'lapply' introduces a function (lapply) that doesn't >>> have an intuitive n

Re: [R] Simulation)

2009-05-14 Thread Peter Flom
I wrote As a beginner, I agree the for loop is much clearer to me. Wacek Kusnierczyk replied > >well, that's quite likely. especially given that typical courses in >programming, afaik, include for looping but not necessarily functional >stuff -- are you an r beginner, or a programming

Re: [R] Simulation

2009-05-14 Thread Barry Rowlingson
> As a beginner, I agree the for loop is much clearer to me. > [Warning: Contains mostly philosophy] To me, the world and how I interact with it is procedural. When I want to break six eggs I do 'get six eggs, repeat "break egg" until all eggs broken'. I don't apply an instance of the break

Re: [R] Simulation)

2009-05-14 Thread Wacek Kusnierczyk
Peter Flom wrote: > As a beginner, I agree the for loop is much clearer to me. > > >> well, that's quite likely. especially given that typical courses in >> programming, afaik, include for looping but not necessarily functional >> stuff -- are you an r beginner, or a programming beginne

Re: [R] Simulation

2009-05-14 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: >> As a beginner, I agree the for loop is much clearer to me. >> >> > > [Warning: Contains mostly philosophy] > maybe quasi ;) > To me, the world and how I interact with it is procedural. When I want > to break six eggs I do 'get six eggs, repeat "break egg"

Re: [R] Simulation

2009-05-14 Thread Ted Harding
On 14-May-09 11:28:17, Wacek Kusnierczyk wrote: > Barry Rowlingson wrote: >>> As a beginner, I agree the for loop is much clearer to me. >> >> [Warning: Contains mostly philosophy] >> > maybe quasi ;) > >> To me, the world and how I interact with it is procedural. When I want >> to break

Re: [R] Simulation

2009-05-14 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: > > Computer scientists will write their beautiful manuscripts, but how > many people who come to R because they want to do a t-test or fit a > GLM will read them? That's the R-help audience now. > don't forget that r seems to take, maybe undeserved, the pride of being

Re: [R] Simulation

2009-05-14 Thread Debbie Zhang
ierc...@idi.ntnu.no > To: b.rowling...@lancaster.ac.uk > CC: r-help@r-project.org > Subject: Re: [R] Simulation > > Barry Rowlingson wrote: > > On Wed, May 13, 2009 at 9:56 PM, Wacek Kusnierczyk > > wrote: > > > >> Barry Rowlingson wrote: > >> >

Re: [R] Simulation

2009-05-14 Thread Stefan Grosse
Debbie Zhang schrieb: > Now, I am trying to obtain the sample variance (S^2) of the 1000 samples that > I have generated before. > > I am wondering what command I should use in order to get the sample variance > for all the 1000 samples. > > > > What I am capable of doing now is just typing in

Re: [R] Simulation

2009-05-14 Thread Linlin Yan
Since you got the most suitable way to get x, why can't you get the variances in the same way? Just like: v = vector() for (i in 1:length(x)) v[i] = var(x[[i]]) BTW, it is much better to use lapply, like this: lapply(x, var) On Thu, May 14, 2009 at 8:26 PM, Debbie Zhang wrote: > > Thanks f

Re: [R] Simulation

2009-05-14 Thread Wacek Kusnierczyk
Stefan Grosse wrote: > Debbie Zhang schrieb: > >> Now, I am trying to obtain the sample variance (S^2) of the 1000 samples >> that I have generated before. >> >> I am wondering what command I should use in order to get the sample variance >> for all the 1000 samples. >> >> >> >> What I am ca

Re: [R] Simulation

2009-05-15 Thread Kon Knafelman
rmulas for my n=15, but im unsure how to proceed in the quickest way. Can someone please help? Much appreciated :) > From: r.tur...@auckland.ac.nz > Date: Thu, 14 May 2009 10:26:38 +1200 > To: c...@witthoft.com > CC: r-help@r-project.org > Subject: Re: [R] Simulation >

Re: [R] Simulation

2009-05-15 Thread Stefan Grosse
On Fri, 15 May 2009 19:17:37 +1000 Kon Knafelman wrote: KK> I hve the same problem as the initial one, except i need 1000 KK> samples of size 15, and my distribution is Exp(1). I've adjusted KK> some of the loop formulas for my n=15, but im unsure how to proceed KK> in the quickest way. KK> Can

Re: [R] Simulation

2009-05-15 Thread Ben Bolker
On Fri, 15 May 2009 19:17:37 +1000 Kon Knafelman wrote: KK> I hve the same problem as the initial one, except i need 1000 KK> samples of size 15, and my distribution is Exp(1). I've adjusted KK> some of the loop formulas for my n=15, but im unsure how to proceed KK> in the quickest way. KK> Ca

Re: [R] Simulation

2009-05-15 Thread Greg Snow
n...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Ben Bolker > Sent: Friday, May 15, 2009 6:37 AM > To: r-help@r-project.org > Subject: Re: [R] Simulation > > > > On Fri, 15 May 2009 19:17:37 +1000 Kon Knafelman > wrote: > > KK> I hve the

Re: [R] Simulation

2009-05-15 Thread Ben Bolker
Greg Snow wrote: > Another possibility (maybe more readable, gives the option of a list, > probably not faster): > > Replicate(1000, rexp(15,1) ) > I think that should be "replicate" The matrix form is quite a bit faster, but don't know if that will matter -- times below are for doing this

Re: [R] Simulation

2009-05-15 Thread Greg Snow
(Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: Ben Bolker [mailto:bol...@ufl.edu] > Sent: Friday, May 15, 2009 10:19 AM > To: Greg Snow > Cc: r-help@r-project.org > Subject: Re: [R] Simula

Re: [R] Simulation

2009-05-15 Thread Wacek Kusnierczyk
Greg Snow wrote: > Another possibility (maybe more readable, gives the option of a list, > probably not faster): > > Replicate(1000, rexp(15,1) ) > > provided that simplify=FALSE: is(replicate(10, rexp(15, 1))) # "matrix" ... is(replicate(10, rexp(15, 1), simplify=FALSE)) # "

[R] Simulation Help

2009-05-17 Thread Kon Knafelman
Hey Guys, i need 1000 samples of size 15, for distributions of Exp(1) and Norm(0,1). here is what i have done so far.For the exponential z<-list() for(i in 1:1000){z[[i]]=rexp(15,1)} For the Normal y<-list() for(i in 1:1000){y[[i]]=rnorm(15,0,1)} Is this correct? after this i need to compu

Re: [R] Simulation

2009-05-18 Thread Kon Knafelman
first place, your input is highly appreciated using your method, im getting a bit confused. > Date: Fri, 15 May 2009 12:16:45 +0100 > From: s.elli...@lgc.co.uk > To: konk2...@hotmail.com > Subject: Re: [R] Simulation > > The tidiest way of doing something 'simple' with a se

Re: [R] Simulation

2009-05-18 Thread Kon Knafelman
gt; Date: Thu, 14 May 2009 12:05:30 +0100 > From: b.rowling...@lancaster.ac.uk > To: peterflomconsult...@mindspring.com > CC: waclaw.marcin.kusnierc...@idi.ntnu.no; r-help@r-project.org > Subject: Re: [R] Simulation > > > As a beginner, I agree the for loop is much clea

[R] Simulation function

2009-08-18 Thread MarcioRibeiro
Hi listers, I've been looking for a procedure, but I am not succeding... I have a function that give multiple results... Then, I would like to simulate this function n times, so I need to save/keep the n multiple results, in order to calculate my desired statistics... I have already tried with the

[R] simulation by pca

2008-01-23 Thread TEBBI FATIMA
deer friends i am working in simulation with using R i know how fonction reconst work but my query is how to simulate using PCA with R?? THANK YOU - [[alternative HTML version deleted]] ___

[R] Simulation of data

2008-10-20 Thread Marcioestat
Hi listers, I am working on a program of statistical analysis of simulated data and I've been searching the error at the program, but I didn't find it! It is something about the WHILE procedure, the error says: Error in while (ecart >= d) { : missing value where TRUE/FALSE needed Thanks in advance

[R] simulation using ranks

2007-10-08 Thread Robinson Tomniavia
Hi there, how can i do simulations(100,000) using ranks. I mean i subtract main effects from the observations to form residuals, then i ranked the residuals. Next i allocate the ranks in place of the observations and do a nonparametric analysis on the ranks. The original data (observation) is ge

[R] Simulation code error

2009-07-15 Thread Steve Hong
Dear List, I have some problem with my simulation code. Here is output from R: > sim.sp <- function(data,CM,n,N) + { + C <- matrix(rep(NA,N),ncol=1) + for(i in 1:N) + { + j <- n + xx <- which(colSums(CM[j,])==1) + V <- names(xx) + V <- paste(V, collapse="+") + V <- paste("SBA~", V) + rd <- round

Re: [R] Simulation function

2009-08-18 Thread jim holtman
You need to store your results in a list and then access the information in the list to get the values: > boot<-function(a,b,c){ + media<-(a+b+c)/3 + var_app<-var(a) + list(media=media,var_app=var_app) + } > boot(2,4,10) $media [1] 5.33 $var_app [1] NA > > simul<-function(S){ +

[R] Simulation of linear lists

2009-01-31 Thread Christian Hoffmann
Hi there has anybody experimented with the implementation in R of linear lists, as described e.g. in books on Pascal (Jensen and Wirth), or Wirth, "Algorithms and data structures" ? See \url{www.dbnet.ece.ntua.gr/~adamo/csbooksonline/AD.pdf } Pointers would be welcome. Christian -- -- Chri

[R] Simulation study in R

2008-04-28 Thread Arun Kumar Saha
Here I am in a simulation study where I want to find different values of x and y such that f(x,y)=c (some known constant) w.r.t. x, y >0, y<=x and x<=c1 (another known constant). Can anyone please tell me how to do it efficiently in R. One way I thought that I will draw different random numbers fro

[R] simulation study using R

2008-03-03 Thread Davood Tofighi
Dear All, I am running a Monte Carlo simulation study and have some questions on how to manage data storage efficiently at the end of each 1000 replication loop. I have three conditions coded using the FOR {} loops and a FOR loop that generates data for each condition, performs analysis, and compu

Re: [R] Simulation of data

2008-10-20 Thread Barry Rowlingson
2008/10/21 Marcioestat <[EMAIL PROTECTED]>: > > Hi listers, > I am working on a program of statistical analysis of simulated data and I've > been searching the error at the program, but I didn't find it! > It is something about the WHILE procedure, the error says: Error in while > (ecart >= d) { :

Re: [R] Simulation of data

2008-10-21 Thread Marcioestat
Hi Barry, As you explained I find out my mistake... I wasn't supposed to use a recursive formula! So, what I needed, it's just to use the proportion by the function mean to reach my results... Thanks, Márcio Barry Rowlingson wrote: > > 2008/10/21 Marcioestat <[EMAIL PROTECTED]>: >> >> Hi lister

[R] simulation of autoregressive process

2008-11-19 Thread hassen62
Dear R users, I would like to simulate, for 2 replications, an autoregressive process: y(t)=0.8*y(t-1)+e(t) where e(t) is i.i.d.(0,sigma*sigma), Thank you in advance Écoutez gratuitement le nouveau single de Noir Désir et découvrez d'au

[R] Simulation Result display form

2008-11-21 Thread Abelian
after obtaining the result, the result is displayed below: individual RS_number Phy_Posi LOH_intensity 1 1718890 rs1496555 2.2241110.8121 2 1668776 rs2376495 3.0849860.786 <--- 3 1723597 rs4648462 3.1551270.784 <--- 4 1728870 rs10492940 3.1876070.7831

[R] simulation in multilevel model

2009-07-13 Thread Zoltan
Dear List Members, I am running a random intercept and random slope (2 cross-level interactions) MLM using package lme4 (individuals nested in countries, number of 2nd level units is 21). My DV (member of a trade union or not) is dichotomous, and thus it is a logistic multilevel model. The model c

Re: [R] Simulation code error

2009-07-15 Thread Roger Bivand
This message is one of a number of identical copies, also cross-posted to R-sig-geo, and in fact with an obvious solution that the author gives at the end. The thread will be continued on R-sig-geo. Cross posting is advised against expressly in e.g. http://en.wikipedia.org/wiki/Crossposting, and

[R] Simulation Function - Save results

2009-08-14 Thread MarcioRibeiro
Hi listers, I am working on a simulation... But I am having some troubles... Suppose I have a function A which produces two results (mean and variance)... Then I would like to simulate this function A with a function B many times using the results from function A For example: #Function A boot<-fu

Re: [R] Simulation study in R

2008-04-29 Thread Moshe Olshansky
Are the pairs (x,y) belong to some lattice or can change continuously? Does f assume some discrete values (or is constant on sets of positive measure)? If not then it will be hard to randomly select x and y which satisfy the exact equality (this still can happen since there are finitely many comput

Re: [R] Simulation study in R

2008-04-29 Thread Arun Kumar Saha
x, y are cont. variable, and f also have to be cont.. And your second suggestion is correct of course, it actually should be |f(x,y) - c| < epsilon Thanks On Tue, Apr 29, 2008 at 12:34 PM, Moshe Olshansky <[EMAIL PROTECTED]> wrote: > Are the pairs (x,y) belong to some lattice or can > change cont

Re: [R] Simulation study in R

2008-04-29 Thread Robert A LaBudde
At 02:40 AM 4/29/2008, Arun Kumar Saha wrote: Here I am in a simulation study where I want to find different values of x and y such that f(x,y)=c (some known constant) w.r.t. x, y >0, y<=x and x<=c1 (another known constant). Can anyone please tell me how to do it efficiently in R. One way I thoug

[R] Simulation Case/Control R Beginner

2008-05-06 Thread Claire_6700
I am looking for a way to simulate genotypes of cases and control at a disease locus in R. I am supposed to set the allele frequency as control/cases. for each of the column below simulate 200 snp dataset. I am looking at treesim function from popgen to stimulate the genotypes in R. Here is what

Re: [R] simulation study using R

2008-03-03 Thread jim holtman
What is the format of the data you are storing (single value, multivalued vector, matrix, dataframe, ...)? This will help formulate a solution. What do you plan to do with the data? Are you going to do further analysis, write it to flat files, store it in a data base, etc.? How big are the data

Re: [R] simulation study using R

2008-03-03 Thread Davood Tofighi
Thanks for your reply. For each condition, I will have a matrix or data frames of 1000 rows and 4 columns. I also have a total of 64 conditions for now. So, in total, I will have 64 matrices or data frames of 1000 rows and 4 columns. The format of data I would like to store would be data frames or

Re: [R] simulation study using R

2008-03-04 Thread jim holtman
One of the things you might take a look at is the 'filehash' package. It is an easy way of storing/retrieving R objects. I have an application where my objects are matrices of about the same size and I can quickly store the data and then come back later with a different script to do further analys

Re: [R] simulation study using R

2008-03-05 Thread Paul Gilbert
Davood Tofighi wrote: > Thanks for your reply. For each condition, I will have a matrix or data > frames of 1000 rows and 4 columns. I also have a total of 64 conditions for > now. So, in total, I will have 64 matrices or data frames of 1000 rows and 4 > columns. The format of data I would like to

Re: [R] simulation study using R

2008-03-05 Thread Davood Tofighi
Thanks to All, The comments were very helpful; however, the the simulation is running very slow. I reduced the number of loops (conditions) so I have 36 loops, and the data-generation occurs 1000 times within each loop. At the end of each 1000 reps, I saved the summary (e.g., mean) of the reps to

Re: [R] simulation of autoregressive process

2008-11-19 Thread Prof Brian Ripley
?arima.sim On Wed, 19 Nov 2008, [EMAIL PROTECTED] wrote: Dear R users, I would like to simulate, for 2 replications, an autoregressive process: y(t)=0.8*y(t-1)+e(t) where e(t) is i.i.d.(0,sigma*sigma), Thank you in advance ??coutez gra

Re: [R] simulation of autoregressive process

2008-11-19 Thread Rolf Turner
On 20/11/2008, at 10:54 AM, [EMAIL PROTECTED] wrote: Dear R users, I would like to simulate, for 2 replications, an autoregressive process: y(t)=0.8*y(t-1)+e(t) where e(t) is i.i.d.(0,sigma*sigma), Thank you in advance ?arima.sim Note to R-core: This is actually rather hard for a neo

Re: [R] Simulation Result display form

2008-11-21 Thread jim holtman
Use something like sprintf if you want trailing zeros. > x [1] 0.78 > sprintf("%.4f", x) [1] "0.7800" > On Fri, Nov 21, 2008 at 5:31 AM, Abelian <[EMAIL PROTECTED]> wrote: > after obtaining the result, the result is displayed below: > > individual RS_number Phy_Posi LOH_intensity > 1 1718

Re: [R] Simulation Function - Save results

2009-08-14 Thread Zhiliang Ma
in order to return more multiple variables, you can put them in a list and then return this list. e.g. #Function A boot<-function(a,b,c){ mean_boot<-(a+b)/2 var_boot<-c list(mean_boot = mean_boot, var_boot = var_boot) } out <- boot(1,2,3) out $mean_boot [1] 1.5 $var_boot [1] 3 On Fri, Aug 1

Re: [R] Simulation Function - Save results

2009-08-18 Thread MarcioRibeiro
Ok, the LIST function I understood... What I would like now is to simulate this Function A many times (S) in order to get S results for the MEAN and for the VARIANCE... Zhiliang Ma wrote: > > in order to return more multiple variables, you can put them in a list > and then return this list. >

Re: [R] Simulation Function - Save results

2009-08-18 Thread David Winsemius
On Aug 17, 2009, at 1:40 PM, MarcioRibeiro wrote: Ok, the LIST function I understood... I didn't see how you got a "random" input to that function. Would seem to need one of the r functions as input. What I would like now is to simulate this Function A many times (S) in order to get S

[R] Simulation from a multivariate normal distribution

2009-05-18 Thread Barbara . Rogo
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]] ___

[R] Simulation of population dynamics in R?

2009-09-06 Thread Oliver Bandel
Hello, are there simulation packages to simulate population dynamics, for example for epidemiology? Or are there (open source) tools that can do that task and can be used from within R (or at least can read the resulting data files)? Oliver __ R-help

Re: [R] simulation study using R [SEC=UNCLASSIFIED]

2008-03-03 Thread Augusto.Sanabria
March 2008 11:06 To: r-help@r-project.org Subject: [R] simulation study using R Dear All, I am running a Monte Carlo simulation study and have some questions on how to manage data storage efficiently at the end of each 1000 replication loop. I have three conditions coded using the FOR {} loo

Re: [R] Simulation from a multivariate normal distribution

2009-05-18 Thread Liaw, Andy
Check out the help page for replicate(). Andy From: barbara.r...@uniroma1.it > > 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

Re: [R] Simulation from a multivariate normal distribution

2009-05-18 Thread Uwe Ligges
barbara.r...@uniroma1.it wrote: 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?" ?replicate Uwe

Re: [R] Simulation from a multivariate normal distribution

2009-05-18 Thread Peter Dalgaard
Liaw, Andy wrote: Check out the help page for replicate(). Andy Or the 'n' argument to mvrnorm (or mvtnorm::rmvnorm for that matter)... From: barbara.r...@uniroma1.it I must to create an array with dimensions 120x8x500. Better I have to make 500 simulations of 8 series of return from a mul

[R] Desperatly seeking Parallel R simulation with Windows XP

2008-09-30 Thread quant15
ss to Linux due to professionnal reasons ... so I must work with windows XP. Do somebody know a way to unleash the calculation power of all four cores under windows XP ? Thanks for your help !! Quant15 -- View this message in context: http://www.nabble.com/Desperatly-seeking-Parallel-R-simul

[R] Simulation functions for underdispered Poisson and binomial distributions

2009-07-14 Thread Shinichi Nakagawa
Dear R users I would like to simulate underdispersed Poisson and binomial distributions somehow. I know you can do this for overdispersed counterparts - using rnbinom() for Poisson and rbetabinom() for binomial. Could anyone share functions to do this? Or please share some tips for modi

Re: [R] Desperatly seeking Parallel R simulation with Windows XP

2008-09-30 Thread Rainer M Krug
your help !! > > Quant15 > -- > View this message in context: > http://www.nabble.com/Desperatly-seeking-Parallel-R-simulation-with-Windows-XP-tp19737748p19737748.html > Sent from the R help mailing list archive at Nabble.com. > > __

Re: [R] Desperatly seeking Parallel R simulation with Windows XP

2008-09-30 Thread Erin Hodgess
a cluster of all your four cores. > > As I don't have a dual or quadcore running windows, I can't confirm > that it is actually using all cores (it does under Linux), but the > cluster is created. > > If you have further questions, just ask - I am learning t

Re: [R] Desperatly seeking Parallel R simulation with Windows XP

2008-10-01 Thread quant15
t confirm > that it is actually using all cores (it does under Linux), but the > cluster is created. > > If you have further questions, just ask - I am learning tio use snow as > well. > > Rainer > > > >> >> Thanks for your

Re: [R] Simulation functions for underdispered Poisson and binomial distributions

2009-07-15 Thread Charles C. Berry
On Wed, 15 Jul 2009, Shinichi Nakagawa wrote: Dear R users I would like to simulate underdispersed Poisson and binomial distributions somehow. I know you can do this for overdispersed counterparts - using rnbinom() for Poisson and rbetabinom() for binomial. Could anyone share functions to

[R] simulation and solution to SDE with jumps and point processes?

2008-04-19 Thread Michael
Hi all, I am looking for toolboxes that can handle simulation and/or solution of SDE with jumps, say levy processes, jump diffusion processes, etc. Could anybody give me some pointers to really good ones in R, (or Maple or Matlab)? I did google search myself and haven't found much...I would also l