mlestimate {bbl} | R Documentation |
Perform inference of bias and interaction parameters for a single response group
mlestimate(xi, method = "pseudo", L = NULL, lambda = 1e-05, lambdah = 0, symmetrize = TRUE, eps = 0.9, nprint = 100, itmax = 10000, tolerance = 1e-05, verbose = 1, prior.count = TRUE, naive = FALSE, lz.half = FALSE)
xi |
Data matrix. In contrast to |
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 |
Use 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 train
rather than directly.
List of inferred parameters h
and J
. See
bbl
for parameter structures.
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')