runFieldModel: Run a Model and Estimate Underlying Field From Point and...

Description Usage Arguments Value Examples

View source: R/runFieldModel.R

Description

Run a model and estimate underlying latent and probability field from point and polygon data using TMB.

Usage

1
2
3
4
runFieldModel(field, pointDF = NULL, polyDF = NULL, moption = 0,
  verbose = FALSE, symbolic = TRUE, control = list(eval.max = 10000,
  iter.max = 10000), rWidth = NULL, priors = FALSE, mcmc = FALSE,
  AprojPoly = NULL, shape3 = NULL, start = list(), ...)

Arguments

field

field object which simulated underlying data

pointDF

data simulated from samplePoints

polyDF

data simulated from samplePolygns

moption

int, intger indicating how polygon data should be estimated 0 is by mixed model approximation, 1 is by redistribution, 2 is by Utazi approach, 3 is by riemman approximation, 4 is ignoring polygon data, 5 is if all data was known.

verbose

logical, print model fitting information

symbolic

logical, use metas reordering in model fitting

control

list, control list passed to nlminb

rWidth

int, only used in moption 2 to build besag prior

priors

logical, default FALSE Should priors be evaluated for top level parameters.

mcmc

logical, default FALSE Should model be fit with MCMC. Not compatible with moption 2.

AprojPoly

sparseMatrix, sparse matrix with population weight information for polygons.

shape3

shape to build the adjaceny matrix for when moption == 2

start

starting points of parameters.

...

Further arguments to pass to tmbstan

Value

List of fitted model objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
unitSim <- simField(
N = 500, rangeE = .7,
offset = c(0.1, 0.2), 
max.edge = c(0.1,0.2),
beta0 = -2,
betaList = list(
    list(type="random", value=2),
    list(type="spatial", value=-.5),
    list(type="cluster", value=-2)
))

pointDF <- samplePoints(unitSim, 500, 100)

runFieldModel(unitSim, pointDF)


## End(Not run)

nmmarquez/PointPolygon documentation built on Dec. 10, 2020, 1:15 a.m.