/in.progress/auteur/man/calibrate.proposalwidth.Rd

http://github.com/eastman/auteur · Unknown · 50 lines · 46 code · 4 blank · 0 comment · 0 complexity · 1184f94f92f1013de056e6a49add9c60 MD5 · raw file

  1. \name{calibrate.proposalwidth}
  2. \alias{calibrate.proposalwidth}
  3. %- Also NEED an '\alias' for EACH other topic documented here.
  4. \title{
  5. initialize proposal width
  6. }
  7. \description{
  8. Generates a reasonable proposal width to initiate sampling for Markov sampling
  9. }
  10. \usage{
  11. calibrate.proposalwidth(phy, dat, nsteps = 100, model, widths = NULL, lim = list(min = 0, max = 1000))
  12. }
  13. %- maybe also 'usage' for other objects documented here.
  14. \arguments{
  15. \item{phy}{
  16. a phylogenetic tree of class 'phylo'}
  17. \item{dat}{
  18. a named vector of continuous trait values, associated with each species in \code{phy}}
  19. \item{nsteps}{
  20. number of proposal steps over which to assess proposal widths}
  21. \item{model}{
  22. currently either \code{model="BM"} or \code{model="OU"} for Brownian motion or an Ornstein-Uhlenbeck process;
  23. see \code{\link[auteur]{rjmcmc.bm}} for further information on fitting these models}
  24. \item{widths}{
  25. if unspecified, a series of proposal widths from 1/8 to 8 will be considered}
  26. \item{lim}{a numeric list defining lower (\code{min}) and upper (\code{max}) bounds on relative rates}
  27. }
  28. \details{
  29. This is primarily an internal function, although may be useful for constraining subsequent runs after an adequate proposal width has been approximated by this function. This
  30. function is called internally by \code{rjmcmc}, which causes additional sampling (one-tenth total Markov chain length) to be prepended to a run. The sole purpose of this initial
  31. sampling period is to optimize the proposal width (\code{prop.width}) to ensure that the Markov chain achieves convergence. Estimates from this calibration are not stored and do not become
  32. available to the user.}
  33. \author{
  34. JM Eastman}
  35. \examples{
  36. n=4
  37. phy=rescaleTree(phy=rcoal(n=n),totalDepth=100)
  38. dat=rTraitCont(phy=phy, model="BM", sigma=sqrt(0.1))
  39. r=paste(sample(letters,9,replace=TRUE),collapse="")
  40. ## with calibrated proposal width
  41. rjmcmc.bm(phy=phy, dat=dat, ngen=5000, sample.freq=10, prob.mergesplit=0.05, prop.width=NULL, fileBase=r)
  42. ## with enforced (and large) proposal width
  43. rjmcmc.bm(phy=phy, dat=dat, ngen=5000, sample.freq=10, prob.mergesplit=0.05, prop.width=10, fileBase=r)
  44. ## PASTE UNCOMMENTED FOLLOWING LINE TO DROP DIRECTORIES CREATED BY RJMCMC
  45. # unlink(dir(pattern=paste(r)),recursive=TRUE)
  46. }