PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/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{
 5initialize proposal width
 6}
 7\description{
 8Generates a reasonable proposal width to initiate sampling for Markov sampling
 9}
10\usage{
11calibrate.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}{
16a phylogenetic tree of class 'phylo'}
17  \item{dat}{
18a named vector of continuous trait values, associated with each species in \code{phy}}
19  \item{nsteps}{
20number of proposal steps over which to assess proposal widths}
21  \item{model}{
22currently either \code{model="BM"} or \code{model="OU"} for Brownian motion or an Ornstein-Uhlenbeck process; 
23see \code{\link[auteur]{rjmcmc.bm}} for further information on fitting these models}
24  \item{widths}{
25if 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}
29\details{
30This 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 
31function 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 
32sampling 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 
33available to the user.}
34\author{
35JM Eastman}
36\examples{
37n=4
38phy=rescaleTree(phy=rcoal(n=n),totalDepth=100)
39dat=rTraitCont(phy=phy, model="BM", sigma=sqrt(0.1))
40r=paste(sample(letters,9,replace=TRUE),collapse="")
41
42## with calibrated proposal width
43rjmcmc.bm(phy=phy, dat=dat, ngen=5000, sample.freq=10, prob.mergesplit=0.05, prop.width=NULL, fileBase=r)
44
45## with enforced (and large) proposal width
46rjmcmc.bm(phy=phy, dat=dat, ngen=5000, sample.freq=10, prob.mergesplit=0.05, prop.width=10, fileBase=r)
47
48## PASTE UNCOMMENTED FOLLOWING LINE TO DROP DIRECTORIES CREATED BY RJMCMC
49 # unlink(dir(pattern=paste(r)),recursive=TRUE)
50}