GetBMA: Compute the Bayesian Model average

Description Usage Arguments Value Author(s) See Also Examples

View source: R/approximations.R

Description

This function uses the posterior realizations from a est_mix_bdmcmc call, to compute the Bayesian Model Average across different number of components and returns the fitted Poisson point process with mixture of normals intensity surface.

For examples see

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

Usage

1
2
GetBMA(fit, win = fit$data$window, burnin = fit$L/10, LL = 100,
  zlims = c(0, 0))

Arguments

fit

Object of class bdmcmc_res.

win

An object of class owin.

burnin

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

LL

Length of the side of the square grid. The density or intensity is calculated on an L * L grid. The larger this value is, the slower the calculation, but the better the approximation as well as the smoother the resulting plots.

zlims

The limits of the z axis. Defaults to [0,max(z)].

Value

An image as an object of class im.object.

Author(s)

Sakis Micheas

See Also

est_mix_bdmcmc, plotmix_3d, plot_density

Examples

1
2
3
4
5
6
7
8
fit=est_mix_bdmcmc(pp = spatstat::redwood, m = 5)
BMA=GetBMA(fit)
burnin=.1*fit$L
title1 = paste("Bayesian model average of",fit$L-burnin,"posterior realizations")
plotmix_3d(BMA,title1=title1)
plot_density(as.data.frame(BMA))+ggplot2::ggtitle("Bayesian model average intensity surface")
plot_density(as.data.frame(BMA),TRUE)+ggplot2::ggtitle(
 "Contours of the Bayesian model average intensity surface")

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