Function used for defining of smooth and spatial terms within ngme model formulae. The function is a wrapper function for specific submodels. (see ngme_models_types() for available models).

f(
  map,
  model,
  noise = noise_normal(),
  mesh = NULL,
  control = control_f(),
  name = "field",
  data = NULL,
  group = NULL,
  which_group = NULL,
  W = NULL,
  fix_W = FALSE,
  fix_theta_K = FALSE,
  prior_theta_K = ngme_prior("normal", param = c(0, 0.001)),
  subset = rep(TRUE, length_map(map)),
  debug = FALSE,
  ...
)

Arguments

map

symbol or numerical value: index or covariates to build index

model

string, model type, see ngme_model_types()

noise

can be either string or a ngme_noise object

mesh

mesh for the model, if not provided, will be built from map, can be a list of meshs for different replicates

control

control variables for latent model

name

name of the field, for later use, if not provided, will be "field1" etc.

data

specifed or inherit from ngme() function

group

group factor indicate resposne variable, can be inherited from ngme() function

which_group

belong to which group

W

starting value of the process

fix_W

stop sampling for W

fix_theta_K

fix the estimation for theta_K.

prior_theta_K

prior for theta_K

subset

subset of the model

debug

debug mode

...

additional arguments (e.g. parameters for model) inherit the data from ngme function

Value

a list for constructing latent model, e.g. A, h, C, G, which also has 1. Information about K matrix 2. Information about noise 3. Control variables