Rev Language Reference


mvCharacterHistory - Character history move

A proposal to change the (discrete) character history, at a node or along a branch, for data augmentation-based CTMC distributions (`dnPhyloCTMCDASiteIID` or `dnPhyloCTMCDASequence`).

Usage

mvCharacterHistory(AbstractHomologousDiscreteCharacterData ctmc, RateGenerator qmap_site, RateGeneratorSequence qmap_seq, Probability lambda, String graph, String proposal, RealPos weight, Probability tuneTarget)

Arguments

ctmc : AbstractHomologousDiscreteCharacterData (<stochastic> pass by reference)
The PhyloCTMC variable.
qmap_site : RateGenerator (pass by reference)
Per-site rate generator.
Default : NULL
qmap_seq : RateGeneratorSequence (pass by reference)
Per-sequence rate generator.
Default : NULL
lambda : Probability (pass by value)
Tuning probability to propose new site history (has no effect if graph="cladogenetic" and proposal="rejection_shift").
Default : 1
graph : String (pass by value)
The location(s) in a phylogeny where the move is placed
Default : node
Options : node|branch|cladogenetic|cladogenetic2|tip|root
proposal : String (pass by value)
The type of sampler
Default : rejection
Options : rejection|rejection_shift|uniformization
weight : RealPos (pass by value)
The weight determines the relative frequency with which this move will be attempted. For details, see the description of the 'moveschedule' parameter on the documentation page for 'mcmc()'.
Default : 1
tuneTarget : Probability (pass by value)
The acceptance probability targeted by auto-tuning (has no effect if graph="cladogenetic" and proposal="rejection_shift").
Default : 0.44

Details

The `graph` argument specifices where the move is put, the `proposal` argument specifies the type of sampler, while the `type` argument specifies the type of character. For state-dependent trait evolution (e.g, `dnPhyloOUSD`), moves can be put at the root node (`graph="root"`), at all the internal nodes (`graph="node"`), along branches (`graph="path"`), and at the tips (`graph="tip"`). In all these cases, a rejection sampler is used (`proposal="rejection"`). Note that if a move is put at a node, the sampler will propose new character history for the node and its ancestral and descendant branches (if they exist), without changing the state of the ancestral and descendant nodes. If a move is put along a branch, the sampler will propose new character history for the branch, without changing the state of the ancestral and descendant nodes. The root rejection sampler should only be used when there is only one character. Furthermore, if some tips have unobserved character states, or if a hidden-state model is used for the CTMC distribution, the character type should be set to natural numbers (`type="NaturalNumbers"`). Otherwise, the character type should be set to standard (`type="Standard"`). Refer to respective tutorials for other usage of the data augmentation-based CTMC distributions and the character history move: in particular, biogeographic reconstruction and modeling host repertoire evolution.

Example

# The following example shows the set-up of character history
# moves when the CTMC distribution is used together with a
# trait evolution model (e.g, `dnPhyloOUSD`).

Q <- fnJC(2)
X ~ dnPhyloCTMCDASiteIID(tree, Q, branchRates=1, type="Standard", nSites=1)

moves.append( mvCharacterHistory(ctmc=X, qmap_site=Q, graph="root",
                                 proposal="rejection", weight=10.0) )
moves.append( mvCharacterHistory(ctmc=X, qmap_site=Q, graph="node",
                                 proposal="rejection", weight=10.0) )
moves.append( mvCharacterHistory(ctmc=X, qmap_site=Q, graph="branch",
                                 proposal="rejection", weight=10.0) )
moves.append( mvCharacterHistory(ctmc=X, qmap_site=Q, graph="tip",
                                 proposal="rejection", weight=10.0) )