Learn R Programming

bbl (version 0.1.5)

randompar: Generate random bias and interaction 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]\).

Value

List of parameters, h and J.

Details

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

Examples

Run this code
# NOT RUN {
set.seed(311)
predictors <- list()
for(i in 1:5) predictors[[i]] <- c('a','c')
par <- randompar(predictors=predictors)
par
# }

Run the code above in your browser using DataLab