GetBDCompfit: Retrieve parts of a BDMCMC fit

Description Usage Arguments Value Author(s) See Also Examples

View source: R/postgen_ops.R

Description

The function can be used to obtain the realizations and the corresponding surface of posterior means, for a specific number of components. Use GetPMEst if you want just the surface.

For examples see

http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#GetBDCompfit

Usage

1
GetBDCompfit(BDfit, num_comp, burnin = floor(BDfit$L/10))

Arguments

BDfit

Object of class damcmc_res.

num_comp

Number of components requested. Only the posterior realizations that have this many components will be returned. The function fails if the BDMCMC chain never visited this number of components.

burnin

Number of initial realizations to discard. By default, it is 1/10 of the total number of iterations.

Value

A list containing the following:

BDgens

Realizations corresponging to this many mixture components. This is a damcmc_res object (same as the result of a est_mix_damcmc call). All realizations for the requested number of components are returned, that is, burnin is not applied to this object.

BDsurf

For the requested num_comp, this is the Poisson intensity surface based on the corresponding posterior means (label switching might be present).

BDnormmix

For the requested num_comp, this is a normmix object containing the corresponding ps, mus and sigmas (label switching might be present).

Author(s)

Sakis Micheas

See Also

est_mix_bdmcmc, GetBDTable, plot.damcmc_res, plot.normmix

Examples

1
2
3
4
5
6
7
8
9
fit <- est_mix_bdmcmc(pp = spatstat::redwood, m = 7)
GetBDTable(fit)
#retrieve all BDMCMC realizations corresponding to a mixture with 5 components
BDfit5comp=GetBDCompfit(fit,5)
plot(BDfit5comp$BDsurf,main="Mixture intensity surface with 5 components")
#plot with the correct window
plot(BDfit5comp$BDnormmix,xlim =BDfit5comp$BDsurf$window$xrange,ylim =
 BDfit5comp$BDsurf$window$yrange )
plot(BDfit5comp$BDgens)

sppmix documentation built on Jan. 13, 2021, 10:04 p.m.