Learn R Programming

glmmBUGS (version 2.4.2)

startingFunction: Write a function to generate random MCMC starting values

Description

The code for the resulting function is saved in a file, to be edited and sourced in before calling WinBUGS.

Usage

startingFunction(startingValues, file = "getInits.R")

Arguments

startingValues

list returned from getStartingValues

file

character string giving the name of the file to write to

Value

A file, with the name given by the 'file' argument, is written.

Warning

You are strongly encouraged to edit the file to ensure the result is sensible

Details

Given a list containing initial estimates of parameters and random effects, a text file is produced containing code for a function to generate random starting values for use with the bugs() function. It is intended that the file produced be checked and edited prior to use.

See Also

getStartingValues, bugs

Examples

Run this code
# NOT RUN {
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.
sval = list(intercept=0, beta = 1:2, Rperson = rep(0, 5), vars=list(person=1))
startingFunction(sval)

# }

Run the code above in your browser using DataLab