simulate.fitlgc {lgc}R Documentation

LGC simulation.

Description

Draw simulations from a fitted object of class 'fitlgc'.

Usage

  simulate.fitlgc(object, nsim = 1, seed = NULL,
    type = c("data", "prior", "posterior"), term = NULL,
    fixbeta = (type != "posterior"),
    as.list = (type != "data") & (nsim == 1) & (is.null(term)),
    ...)

Arguments

object

Object of class 'fitlgc'

nsim

Number of simulations.

seed

Simulation seed.

type

What to simulate: 'data', 'prior' or 'posterior'

term

What model term to simulate ('prior' simulation only)

betafix

Should REML estimates be fixed at their estimated values?

as.list

Return simulation in convenient list-format?

...

Details

This function can simulate at any level of the model. If type=='data' then count data will be simulated with parameters as in the fitted object. If type=='prior' then the prior random field will be simulated, including any term of the model formula along with the random effects directly associated with a data-entry. By default, the simulation will be convieniently split in a list with these components (as.list==TRUE). Finally, if type=='posterior' then a posterior sample (i.e. the random field given the data) will be returned. By default, the fixed effects of the model are deterministic (without variation) in the case of type=='data' and type=='prior', and non-deterministic in the case of 'posterior' sampling.

Value

The simulation


[Package lgc version 1.4 Index]