rgeneric.define {INLA} | R Documentation

## rgeneric models

### Description

A framework for defining latent models in R

### Usage

    inla.rgeneric.ar1.model(
      cmd = c("graph", "Q", "mu", "initial", "log.norm.const", "log.prior", "quit"),
      theta = NULL
    )

    inla.rgeneric.ar1.model.opt(
      cmd = c("graph", "Q", "mu", "initial", "log.norm.const", "log.prior", "quit"),
      theta = NULL
    )

    inla.rgeneric.iid.model(
      cmd = c("graph", "Q", "mu", "initial", "log.norm.const", "log.prior", "quit"),
      theta = NULL
    )

    inla.rgeneric.define(
      model = NULL,
      debug = FALSE,
      compile = TRUE,
      optimize = FALSE,
      ...
    )

    inla.rgeneric.wrapper(
      cmd = c("graph", "Q", "mu", "initial", "log.norm.const", "log.prior", "quit"),
      model,
      theta = NULL
    )

    inla.rgeneric.q(
      rmodel,
      cmd = c("graph", "Q", "mu", "initial", "log.norm.const", "log.prior", "quit"),
      theta = NULL
    )

### Arguments

`cmd` | An allowed request
`theta` | Values of theta
`model` | The definition of the model; see `inla.rgeneric.ar1.model`
`debug` | Logical. Enable debug output
`compile` | Logical. Compile the definition of the model or not.
`optimize` | Logical. With this option `TRUE`, then `model` pass only the values of `Q` and not the whole matrix. Please see the vignette for details and `inla.rgeneric.ar1.model.opt` for an example.
`...` | Named list of variables that defines the environment of `model`
`rmodel` | The rgeneric model-object, the output of `inla.rgeneric.define`

### Value

This allows a latent model to be defined in `R`. See `inla.rgeneric.ar1.model` and `inla.rgeneric.iid.model` and the documentation for worked out examples of how to define latent models in this way. This will be somewhat slow and is intended for special cases and protyping. The function `inla.rgeneric.wrapper` is for internal use only.

### Author(s)

Havard Rue hrue@r-inla.org

[Package INLA version 26.02.05 Index]