fitnullmat3: Fit a Poisson marked point process model via MCMC sampling

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/fitnullmat3.R

Description

Markov chain Monte Carlo sampler from Poisson marked spatial point process

Usage

1
2
3
4
5
fitnullmat3(mat3, fname = c("centers.txt", "fingers.txt"),
  win = owin(c(0, 1), c(0, 1)), L = 10000, NN = 2000, seed = NULL,
  resultsName = NULL, logPriors = preparePriors(),
  initialValues = pickInitialValues(), candidateVar = c(0.1, 0.2, 0.1,
  0.1, 0.1), verbose = TRUE, ...)

Arguments

mat3

A mat3 object, see rmat3. If reading from a data file, set to NA instead.

fname

Will only be read if mat3 is set to NA. File names with the centers and fingers dataset, to be read with read.table. The default action assumes the files "centers.txt" and "fingers.txt", each formatted with a header and three columns corresponding to a center ID (integer), and the spatial location of the center/finger end. The fingers file should have at least one finger for each center ID in the centers file.

win

Square window in which the process is to be sampled. See owin. Defaults to the unit square.

L

Number of samples for the MCMC sampler. Defaults to 10000.

NN

Number of samples to Monte-Carlo estimation of constant. Defaults to 2000.

seed

Fixes the RNG seed for replication. Defaults to NULL, which does not fix the seed.

resultsName

Writes the results to a file; defaults to NULL, which does not save the results.

logPriors

A list of 5 log-priors for the coefficients, each being a function of the parameter and initial value only. See preparePriors, which produces the default values of logPriors.

initialValues

Some holistic initial values for empirical priors on the parameters. See pickInitialValues, which produces the default values of initialValues.

candidateVar

Variability of MCMC candidate selection step, if tuning is necessary.

verbose

Prints acceptance rates for candidates. Defaults to TRUE.

...

further arguments passed to read.table.

Value

fitnullmat3 returns a list containing at least the following components

parameters

An L by 5 matrix with the samples from beta, phi, gamma, sigma, kappa.

Author(s)

Guilherme Ludwig and Nancy Garcia

References

Garcia, N., Guttorp, P. and Ludwig, G. (2018) TBD

Geyer, C. J., and Thompson, E. A. (1992) "Constrained Monte Carlo maximum likelihood for dependent data." Journal of the Royal Statistical Society. Series B (Methodological), 657-699.

See Also

rmat3

Examples

1
2
3
4
5
set.seed(1234)
x <- rmat3(70, 2, 5, 0.05, 3)
plot(x)
# Changing default sampling sizes to make it run fast
model <- fitnullmat3(x, L = 100, seed = 1234)

guiludwig/mat3c documentation built on Dec. 2, 2019, 1:32 a.m.