Bayz Manual

Loading starting values for any parameter from an input file

This can be done in the chain section by specifying a file that has the starting values. It is possible to specify starting values only for a selection of parameters. Parameters for which no starting values are given will get the usual default starting values.

In the chain section an init-file can be given to set starting (initial) values for model parameters. This is more general than the values that can be set in the model section (the model section only sets values for distributions' 'hyper-parameters'). With the init-file in the chain section you can also restart a job from the last cycle of a previous job by using the 'last' file from the previous job as this init file.

The chain section can contain a statement init=... with a file name, which specifies a file that contains starting values for model parameters. The values are organised by the names for parameter vectors used in bayz (the names in the left sides of the model lines and shown in the mod-file) and a list of values that matches the length of each parameter vector. 

For instance, take a model which has effects of sex and group as factors and a regression on age:

weight = mean fac.sex fac.group reg.age 

When there are 2 levels for sexes and 5 levels for groups (and the regression will have one level), a file with initial values for the sex, group and age effect will have the lay-out:

fac.sex.weight 0 5.41
fac.group.weight 0 -2.35 5.46 1.78 -0.63
reg.age.weight 0.23

These initial settings assume that the factor effects are fitted "fixed" with a first level zero ("random" effects will have no contraint on the first level). If unsure about names and levels of parameter vectors, a small test-run will produce a lab (label)-file with the decsription of all parameter names and their sizes and levels. Replacing the label information in the lab-file with initial values will make the right format.

The format to specify the initiliazation in the chain section is:

chain
   total=10000
   init=/path/myinit.txt