% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/f.R
\name{f}
\alias{f}
\title{Specifying a latent process model (wrapper function for each model)}
\usage{
f(
  map,
  model,
  noise = noise_normal(),
  name = "field",
  data = NULL,
  group = NULL,
  which_group = NULL,
  replicate = NULL,
  A = NULL,
  W = NULL,
  fix_W = FALSE,
  fix_K = FALSE,
  prior = NULL,
  subset = rep(TRUE, length_map(map)),
  debug = FALSE
)
}
\arguments{
\item{map}{symbol or numerical value: index or covariates to build index}

\item{model}{an \code{ngme_operator} or \code{ngme_operator_def} created by
model constructors such as \code{ar1()}, \code{matern()}, \code{bv()}, etc.}

\item{noise}{ngme_noise object, noise_nig() or noise_gal()}

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

\item{data}{specifed or inherit from ngme() function}

\item{group}{group factor indicate resposne variable, can be inherited from ngme() function, (used for bivariate model)}

\item{which_group}{belong to which group}

\item{replicate}{factor indicating replicate structure for INLA-style replicates.
When provided, operators and A matrices will be block-diagonalized across replicates.}

\item{A}{observation matrix, automatically computed given map and model}

\item{W}{starting value of the process}

\item{fix_W}{stop sampling for W}

\item{fix_K}{fix the estimation of parameter of K}

\item{prior}{prior specification created by \code{prior_*()} or
\code{priors(...)} for operator parameters (\code{theta_K}).}

\item{subset}{subset of the model}

\item{debug}{debug mode}
}
\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
}
\description{
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).
}
\details{
When using different meshes for different replicates, provide the mesh parameter
as a list of mesh objects. The number of meshes should match the number of replicates.
For example: \code{mesh = list(mesh1, mesh2, mesh3)} for 3 replicates.

When using the `replicate` argument, the operator matrices will be block-diagonalized.
For a generic operator K = param1 * Matrix1 + param2 * Matrix2, with 2 replicates,
the resulting operator becomes:
K = param1 * bdiag(Matrix1_rep1, Matrix1_rep2) + param2 * bdiag(Matrix2_rep1, Matrix2_rep2)
Similarly, the A matrix will be block-diagonalized as bdiag(A_rep1, A_rep2, ...).
}
