conflate {tbea}R Documentation

conflate: Calculate the conflation of multiple distributions pdfs, plot = TRUE, from, to, n, add = FALSE

Description

conflate: Calculate the conflation of multiple distributions pdfs, plot = TRUE, from, to, n, add = FALSE

Usage

conflate(pdfs, plot = TRUE, from, to, n, add = FALSE)

Arguments

pdfs

A vector of calls to density_fun for defininf each individual distribution.

plot

Whether to plot using curve

from, to, n

The appropriate values from and to which to calculate the conflation, and a number of points n. These are the same used by the function curve but are still necessary even if no plot is required.

add

Whether to add the curve to an existing plot.

Details

Produces either a plot or a data frame with the x and y values for the conflated PDF. It uses as input a vector of densities constructed with density_fun, and further parameters to be pased to curve if no plot is desired these are still used for returning a data frame with the x and y values from evaluation the conflated PDF on the sequence of x values determined by a number n of equidistant points between from and to.

Value

A tree of class phylo with summary branch lengths in tree$edge.length.

Examples


conflated_normals <- conflate(c("density_fun(x, 'dnorm', mean=0, sd=1)",
                                "density_fun(x, 'dnorm', mean=3, sd=1)"),
                              from=-4, to=4, n=101, plot=FALSE)
plot(conflated_normals)



[Package tbea version 1.5.0 Index]