Sam and Jeremy, It is outside of R, but check the options (including OU) implemented in the DOS PDSIMUL.EXE program, as described here:
Garland, T., Jr., A. W. Dickerman, C. M. Janis, and J. A. Jones. 1993. Phylogenetic analysis of covariance by computer simulation. Systematic Biology 42:265-292. It is quite flexible. Cheers, Ted Theodore Garland, Jr., Ph.D. Professor Department of Biology University of California Riverside, CA 92521 Phone: (951) 827-3524 = Ted's office (with answering machine) Phone: (951) 827-5724 = Ted's lab Phone: (951) 827-5903 = Dept. office Home Phone: (951) 328-0820 FAX: (951) 827-4286 = Dept. office Email: tgarl...@ucr.edu http://biology.ucr.edu/people/faculty/Garland.html List of all publications with PDF files: http://biology.ucr.edu/people/faculty/Garland/GarlandPublications.html Associate Director Network for Experimental Research on Evolution http://nere.bio.uci.edu/ (A University of California Multicampus Research Project) ---- Original message ---- Date: Tue, 19 May 2009 14:19:12 -1000 From: Marguerite Butler <mbut...@hawaii.edu> Subject: Re: [R-sig-phylo] Trait simulations To: r-sig-phylo@r-project.org >Hi Sam and Jeremy, > >On May 19, 2009, at 11:34 AM, Sam Brown wrote: > >> >> >>> I was just wondering if there is a package or function in R that >>> can simulate >>> two continuous traits with a user-specified correlation coefficient >>> using a >>> known tree topology, branch lengths, and a model of Brownian motion >>> (or even >>> OU, if possible)? >> >> >> I stumbled across the ouch package yesterday. >> >> >> http://tsuga.biology.lsa.umich.edu/ouch/ >> >> I haven't used it, but it looks something like what you want. >> > >Sort of... first you should try the development version which is at > >http://r-forge.r-project.org/projects/ouch/ > >Secondly, you can simulate two continuous traits along a phylogeny, >the 'sort of' comes from the "with user-specified correlation >coefficients". There is a data simulator, which you can invoke using > >simulate(x, nsim, seed) > >where x is the result of fitting your data to a phylogeny and a model >of evolution (brown() for Brownian motion, or hansen() for an OU >model). x is therefore a browntree object or a hansentree object. You >can then generate as many simulated datasets as you like (nsim), and >you can optionally set a random number seed, which is useful if you >want to replicate your simulations exactly. (So seed is optional). >See the documentation for hansen (type ?hansen after starting ouch -- >I like require(ouch)), and also hansentree-methods (type methods? >hansentree at the R prompt). > >If you fit a Brownian motion model, you will get back a sigma-squared >matrix, which is the variance of the "drift" process. If you fit a >hansentree object (OU model), you will get back both the sigma squared >matrix and the alpha matrix, which are both correlation matrices in a >way. One describes correlation in the drift terms, the other in the >selection. > >NOW, if what you really want is to generate simulations that will give >you a particular non-phylogenetic correlation between two continuous >characters, then that will be a lot harder. I think you'll have to >play around with different inputs (phenotypic data?) until you hit >upon the right combination (unless you want to change the phylogeny or >the adaptive regimes, of course). Oy vei! But here I'm guessing off >the top of my head. > >So the answer is sort of... It depends on what you mean and what you >want. > >Hope this made some sense. > >Marguerite > >> >> Cheers >> >> Sam >> >> >> _________________________________________________________________ >> Brrr... its getting cold out there� Find someone to light your fire >> this winter at Match.co.nz >> >> Fchannel%2Findex%2Easpx%3Ftrackingid >> %3D1048628&_t=773568480&_r=nzWINDOWSliveMAILemailTAGLINES&_m=EXT >> _______________________________________________ >> R-sig-phylo mailing list >> R-sig-phylo@r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > >____________________________________________ >Marguerite A. Butler >Assistant Professor >Department of Zoology >University of Hawaii >2538 McCarthy Mall, Snyder 405 >Honolulu, HI 96822 > >Dept: 808-956-8617 >Lab: 808-956-5867 >FAX: 808-956-9812 >http://www.hawaii.edu/zoology/faculty/butler.html >http://www2.hawaii.edu/~mbutler >http://www.hawaii.edu/zoology/ > > > > > > [[alternative HTML version deleted]] > >________________ >_______________________________________________ >R-sig-phylo mailing list >R-sig-phylo@r-project.org >https://stat.ethz.ch/mailman/listinfo/r-sig-phylo _______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo