GetMAPEst: Retrieve the surface of MAP estimators

Description Usage Arguments Value Author(s) See Also Examples

View source: R/get_post.R

Description

The function calculates the Maximum A Posteriori (MAP) estimate of the IPPP mixture intensity surface parameters. Use function GetPMEst if you want the surface of posterior means.

For examples see

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

Usage

1
2
GetMAPEst(fit, burnin = floor(fit$L/10), vals, truncate = FALSE,
  priortype = 1, d, mu0, Sigma0, df0, sig0)

Arguments

fit

Object of class damcmc_res or bdmcmc_res.

burnin

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

vals

Contains the density values over the point pattern and realizations in the fit object. This can be obtained via a call to GetDensityValues. If this argument is missing then the density values are computed herein before computing the MAP estimates.

truncate

Logical variable indicating whether or not we normalize the densities of the mixture components to have all their mass within the window defined in the point pattern pp.

priortype

For different types of priors, ignored right now.

d, mu0, Sigma0, df0, sig0

Optional parameters for the prior distributions used: d are the weights of the Dirichlet prior on the component probabilities. mu0 and Sigma0 are the mean and covariance matrix of a bivariate normal that yields the component means. df0 and sig0 are the degrees of freedom and sig0^2*Identity the parameter matrix for the Inverse Wishart prior that yields the component matrices. If omitted they are set to the following values, which are the default values used in est_mix_damcmc: Sigma0=cov(cbind(pp$x,pp$y)), mu0=c(mean(pp$x),mean(pp$y)), sig0=1, df0=10, and d=rep(1,m).

Value

An object of type intensity_surface.

Author(s)

Sakis Micheas

See Also

est_mix_damcmc, rmixsurf, rsppmix, GetPMEst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
truemix_surf <- rmixsurf(m = 3, lambda=100, xlim = c(-3,3), ylim = c(-3,3))
plot(truemix_surf,main="True IPPP intensity surface")
genPPP=rsppmix(intsurf = truemix_surf, truncate = FALSE)
#the larger the number of realizations the better
fit <- est_mix_damcmc(genPPP, m = 3,L=100000)
MAPest=GetMAPEst(fit)
plot(GetPMEst(fit),main="IPPP intensity surface of posterior means")
plot(MAPest,main="IPPP intensity surface of MAP estimates")
fitBD <- est_mix_bdmcmc(pp = genPPP, m = 5)
MAPest=GetMAPEst(fitBD)
plot(MAPest,main="IPPP intensity surface of MAP estimates for MAP m")

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