Description Usage Arguments Value Author(s) Examples

This function performs Metropolis-Hastings MCMC, where the user provides a likelihood function and a phylogenetic tree.

1 2 |

`phy` |
an object of class |

`likelihood_function` |
Function that calculates the likelihood of our diversification model, given the tree. Function should me of the format function(parameters,phy). |

`parameters` |
Initial parameters to start the chain. |

`logtransforms` |
Whether to perform jumps on logtransformed parameters (TRUE) or not (FALSE) |

`iterations` |
Length of the chain |

`burnin` |
Length of the burnin, default is 30 |

`thinning` |
Size of thinning, default = 1 |

`sigma` |
Standard deviation of the jumping distribution, which is N(0, sigma). |

An `MCMC`

object, as used by the package `"coda"`

.

Sebastian Hoehna & Thijs Janzen

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
## MCMC examples are typically very slow ####
## Not run:
require(TESS);
obs <- TESS.sim.age(n = 1, lambda = 0.5, mu = 0.1, age = 10)[[1]];
LL_BD <- function(params, phy) {
lnl <- tess.likelihood(phy, lambda = params[1], mu = params[2],
samplingProbability = 1, log = TRUE);
prior1 <- dunif( params[1], 0, 100, log = TRUE)
prior2 <- dunif( params[2], 0, 100, log = TRUE);
return(lnl + prior1 + prior2);
}
require(coda);
mcmc_out <- mcmc_nltt(obs, LL_BD, c(0.5, 0.1), c(TRUE, TRUE),
iterations = 1000, burnin = 100, thinning = 10, sigma = 1)
plot(mcmc_out);
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.