Learn R Programming

BRugs (version 0.8-2)

modelInits: Loading initial values

Description

This function loads initial values for the MCMC simulation.

Usage

modelInits(fileName, chainNum = NULL)

Arguments

fileName
Character vector of filenames containing the initial values in OpenBUGS format.
chainNum
The initial values will be loaded for the chain number chainNum. By default chainNum is one the first time modelInits is executed and incremented by one after each call modula the number of chains numChains

Value

  • Any syntax errors or inconsistencies in the initial value are displayed. If, after loading the initial values, the model is fully initialized this will be reported by displaying the message model initialized. Otherwise the message initial values loaded but this or another chain contain uninitialized variables will be displayed. The second message can have several meanings:
  • a)If only one chain is simulated it means that the chain contains some nodes that have not been initialized yet.
  • b)If several chains are to be simulated it could mean (a) or that no initial values have been loaded for one of the chains.
  • In either case further initial values can be loaded, or modelGenInits can be executed to try and generate initial values for all the uninitialized nodes in all the simulated chains.

concept

init

Details

This function checks that initial values are in the form of an appropriate R object or rectangular array and that they are consistent with any previously loaded data. If some of the elements in an array are known (say because they are constraints in a parameterisation), those elements should be specified as missing (NA) in the initial values file. Generally it is recommended to load initial values for all fixed effect nodes (founder nodes with no parents) for all chains, initial values for random effects can be generated using the modelGenInits function.

See Also

BRugs, help.WinBUGS