simField: Simulate A continous 2D spatial field evolving over time

Description Usage Arguments Value Examples

View source: R/simField.R

Description

Calculates a continous underlying spatial field for the Dominican Republic over time and across ages for probability of mortality for one of 7 age groups. The final observed field is a linear additive model as described in Wakefield 2017.

Usage

1
2
3
simField(M, rangeE = 0.8, sigmaE = 0.04, rhoAR = 0.9,
  sigmaRW = 0.001, ageB = arm::logit((7:1/1000) + 0.00025),
  deltaUrban = -0.1, offset = 1, max.edge = c(0.15, 0.3))

Arguments

M

Number of years

rangeE

spatial range

sigmaE

spatial variance

rhoAR

Yearly autoregression

sigmaRW

Variation of independent temporal component

ageB

age specfifc effects

deltaUrban

urban effect

offset

mesh creation parameter

max.edge

mesh creation parameter

Value

field object, contains multiple items. Spatial points data frame with raster values for transformed linear combination, and other values. A mesh that was used to create the latent field. The latent field itself. A bounding shape where all observations take place. A projection matrix from the mesh to the entire field of interest. The spde for the matern approximation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
require(tidyverse)

fieldDR <- simField(4, rangeE = 1.3)
 
fieldDR$fqzDF %>%
    ggplot(aes(x=long, y=lat, fill=fqz)) +
    geom_raster() +
    facet_wrap(~year) +
    coord_equal() +
    theme_void() +
    scale_fill_distiller(palette = "Spectral")

## End(Not run)

nmmarquez/DRU5MR documentation built on Sept. 3, 2019, 5:25 a.m.