Skip to contents

Random effects have a multivariate Gaussian distribution with covariance matrix calculated using integrated_covariance. Kernel hyperparameters are given a prior and learnt.

Usage

ik_tmbstan(
  sf,
  nsim_warm = 100,
  nsim_iter = 1000,
  chains = 4,
  cores = parallel::detectCores(),
  L = 10,
  type = "hexagonal",
  ii = NULL,
  ...
)

Arguments

sf

A simple features object with some geometry.

nsim_warm

Number of warmup samples, passed to rstan.

nsim_iter

Number of samples, passed to rstan.

chains

Number of chains, each of which gets nsim_warm + nsim_iter samples, passed to rstan.

cores

Number of cores, passed to rstan, defaults to parallel::detectCores().

L

The number of Monte Carlo samples to draw from each area.

type

The type argument of sf::st_sample, defaults to "hexagonal"

ii

The (zero-indexed) indices of the observations held-out.

...

Additional arguments to kernel.

Examples

ik_tmbstan(mw, nsim_warm = 0, nsim_iter = 100, cores = 2)
#> Error in nrow(sf): object 'mw' not found