tgp.trees: Plot the MAP Tree for each height encountered by the Markov...

Description Usage Arguments Details Value Note Author(s) References See Also


Plot the maximum a' posteriori (MAP) tree as a function of tree height, and show the log posterior probabilities for comparison.


tgp.trees(out, heights = NULL, main = NULL, ...)



"tgp"-class object which is the output of one the model functions with tree support (e.g. btgpllm)


Index vector of length less than length(out$trees) describing trees to plot by their height. Default (NULL) is to plot all trees, one for each height encountered when sampling from the Markov chain of the tree posterior. This is equivalent to heights = out$posts$height. Specifying heights = "map" causes (only) the maximum a' posteriori (MAP) height tree to be plotted


Optional character string to add to the main title of the plot


Extra arguments to the draw.tree function from maptree


The maximum a' posteriori (MAP) tree encountered at each height (in the MCMC chain) is plotted, and the log posterior probabilities are shown for comparison. The text at the branches in the tree show the splitting variable and value. The text at the leaves show the number of input data points (X and Z) that fall into the region(s) along with an estimate of the variability therein.


The only output of this function is beautiful tree diagrams.


Plotting trees that the maptree library is installed, which itself requires that the combinat library also be installed.

See vignette("tgp") and the examples sections of the functions under “See Also”, below


Robert B. Gramacy,, and Matt Taddy,


See Also

bgpllm, btlm, blm, bgp, btgpllm, plot.tgp, mapT, vignette("tgp")

tgp documentation built on May 19, 2017, 4:12 p.m.

Search within the tgp package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.