randompar {bbl}R Documentation

Generate Random Parameters

Description

Random values of bias and interaction parameters are generated using either uniform or normal distributions.

Usage

randompar(predictors, distr = "unif", h0 = 0, dh = 1, J0 = 0, dJ = 1)

Arguments

predictors

List of predictor factor levels. See bbl.

distr

c('unif','norm') for uniform or normal distributions.

h0

Mean of bias parameters

dh

sd of bias if distr = 'unif'. If distr = 'norm', h = [h_0-dh, h_0+dh].

J0

Mean of interaction parameters.

dJ

sd of interactions if distr = 'unif'. If distr = 'norm', J = [J_0-dJ, J_0+dJ].

Details

Input argument predictors is used to set up proper list structures of parameters.

Value

List of parameters, h and J.

Examples

set.seed(311)
predictors <- list()
for(i in 1:5) predictors[[i]] <- c('a','c')
par <- randompar(predictors=predictors)
par

[Package bbl version 1.0.0 Index]