startingFunction: Write a function to generate random MCMC starting values

Description Usage Arguments Details Value Warning Author(s) See Also Examples

Description

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

Usage

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

Arguments

startingValues

list returned from getStartingValues

file

character string giving the name of the file to write to

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.

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

Author(s)

Patrick Brown, patrick.brown@utoronto.ca

See Also

getStartingValues, bugs

Examples

1
2
3
4
5
##---- 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)

glmmBUGS documentation built on May 2, 2019, 6:08 p.m.