sample_xi {bbl} | R Documentation |
Random samples are drawn from Boltzmann distribution
sample_xi(nsample = 1, predictors = NULL, h, J, code_out = FALSE)
nsample |
Sample size |
predictors |
List of predictor factor levels. |
h |
Bias parameter; see |
J |
Interaction parameters; see |
code_out |
Ouput in integer codes; |
All possible factor states are enumerated exhaustively using
input argument predictors
. If the number of predictors m
or the number of factor levels L_i
for each predictor i
are even moderately large (m\ge 10
or L_i\ge 5
),
this function will likely hang because the number of all possible
states grows exponentially.
Data frame of samples in rows and predictors in columns.
set.seed(512)
m <- 5
n <- 1000
predictors <- list()
for(i in 1:m) predictors[[i]] <- c('a','c','g','t')
par <- randompar(predictors)
xi <- sample_xi(nsample=n, predictors=predictors, h=par$h, J=par$J)
head(xi)