ddbpmm | R Documentation |
The density function for a MOBSTER mixture. The function
allows to compute the density from the data and parameters stored
inside an object of class dbpmm
, or from
a custom set of parameters and data that can be passed as input. The
function can also compute the density only for a subset of components
of the mixture.
ddbpmm(
x,
data = NULL,
components = 1:x$K,
a = NULL,
b = NULL,
pi = NULL,
scale = NULL,
shape = NULL,
log = TRUE
)
x |
An object of class |
data |
Data to compute the (log)-likelihood, if this is null the data stored
inside |
components |
A vector specifying which components should be used to compute the density. Position 1 is reserved for the tail (regardless that is fit or not to the data), the other positions refer to Beta components. |
a |
Vector of parameters for the Beta components; if this is null values stored
inside |
b |
Vector of parameters for the Beta components; if this is null values stored
inside |
pi |
Mixing proportions for the mixture; if this is null values stored
inside |
scale |
Scale of the power law; if this is null values stored
inside |
shape |
Shape of the power law; if this is null values stored
inside |
log |
Boolean value to select the log-likelihood, or the likelihood. |
The density for the data. Notice that to compute the negative log-likelihood
used during fit one needs to use log = TRUE
and change sign.
library(ggplot2)
data('fit_example', package = 'mobster')
# Use the full mixture, and its internal data
ddbpmm(fit_example$best)
# Use only some of the mixture components, and pass some data
ddbpmm(fit_example$best, data = .4, components = 1)
# An internal function to get f(x) with x the [0,1] range.
ggplot(mobster:::template_density(fit_example$best, reduce = TRUE),
aes(x = x, y = y, color = cluster)) + geom_line()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.