Description Usage Arguments Details Value Examples
Perform inference of bias and interaction parameters for a single response group
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
xi |
Data matrix; expected to be numeric with elements ranging from
zero to positive integral upper bound |
weights |
Frequency vector of number of times each row of |
qJ |
Matrix of logicals indicating which predictor pairs are
interacting. If |
method |
|
L |
Vector of number of factor levels in each predictor. If
|
lambda |
Vector of L2 regularization parameters for
|
lambdah |
L2 parameters for |
symmetrize |
Enforce the symmetry of interaction parameters by taking mean values of the matrix and its trace: J_{ij}^{(y)}(x_1,x_2)=J_{ji}^{(y)}(x_2,x_1). |
eps |
Vector of regularization parameters for |
nprint |
Frequency of printing iteration progress under |
itmax |
Maximum number of iterations for |
tolerance |
Upper bound for fractional changes in pseduo-likelihood
values before termiating iteration in |
verbose |
Verbosity level. |
prior.count |
Prior count for |
naive |
Naive Bayes inference. Equivalent to |
lz.half |
Divide interaction term in approximation to \ln Z_{iy}
in |
Given numeric data matrix, either pseudo-likelihood
of mean-field theory is used to find the maximum likelihood estimate
of bias h
and interaction J
parameters. Normally
called by bbl
rather than directly.
List of inferred parameters h
and J
. See
bbl
for parameter structures.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(535)
predictors <- list()
for(i in 1:5) predictors[[i]] <- c('a','c','g','t')
par <- randompar(predictors)
par
xi <- sample_xi(nsample=5000, predictors=predictors, h=par$h, J=par$J,
code_out=TRUE)
head(xi)
ps <- mlestimate(xi=xi, method='pseudo', lambda=0)
ps$h
ps$J[[1]]
mf <- mlestimate(xi=xi, method='mf', eps=0.9)
plot(x=unlist(par$h), y=unlist(ps$h), xlab='True', ylab='Inferred')
segments(x0=-2, x1=2, y0=-2, y1=2, lty=2)
points(x=unlist(par$J), y=unlist(ps$J), col='red')
points(x=unlist(par$h), y=unlist(mf$h), col='blue')
points(x=unlist(par$J), y=unlist(mf$J), col='green')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.