Initial generic functions for model fitting/approximation/prediction of cubfits.
1 2 3 4 5 6 7 8
main fitted model.
proposal method for hyper-parameters.
proposal method for Phi (true expression values).
prior of Phi.
initial methods for Phi.
how is coefficient initialed in
method for adaptive MCMC.
This function mainly takes the options, find the according generic
functions, and assign those functions to
Those generic functions can be executed accordingly later within functions
for MCMC or multinomial logistic regression such as
By default, those options are provided by
.CF.CT which also
leaves rooms for extensions of more complicated models and further
It is supposed to call this function before running any MCMC or
multinomial logistic regression. This function may affect
model is the main fitting model, currently only
type.p is for proposing hyper-parameters in Gibb sampler. Currently,
lognormal_fix is suggested where mean 1 is fixed for log normal
distribution. Conjugated prior and flat prior exist and are easily available
in this step
type.Phi is for proposing Phi (expression values) in the random walk
chain updates. Only,
RW_Norm is supported. Usually, the acceptance
ratio can be adapted within 25% and 50% controlled by
adaptive = simple.
model.Phi is for the distribution of Phi. Typically, log normal
lognormal is assumed.
init.Phi is a way to initial Phi. Posterior mean
is recommended which avoid boundary values.
init.fit is a way of initial coefficients to fit mutation and
selection coefficients (log.mu and
Delta.t or omega)
current means the
(log(mu) and Delta.t) of current MCMC iteration is the initial values, while
vglm() provides the initial values.
parallel is a way of parallel methods to speed up code.
lapply() is used and no parallel;
mclapply() of parallel is used and
good for shared memory machines;
task.pull() of pbdMPI is used and
good for heterogeneous machines;
pbdLapply() of pbdMPI is used and
good for homogeneous machines.
task.pull is tested thoroughly and is the most reliable
and efficient method.
adaptive is a way for adaptive MCMC that propose better mixing
distributions for random walks of Phi. The
simple method is
suggested and only the proposal distribution of Phi
type.Phi = RW_Norm) is adjusted gradually.
Return an invisible object which is a list contain all
generic functions according to the input options.
All functions are also assigned in the
for later evaluations called by MCMC or multinomial logistic regression.
Note that all options are taken default values from the global control
.CF.CT, so one can utilize/alter the object's values
to adjust those affected functions.
phi.Obs should be scaled to mean 1 before
applying to MCMC.
Wei-Chen Chen [email protected].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
## Not run: suppressMessages(library(cubfits, quietly = TRUE)) set.seed(1234) # Convert data. reu13.list <- convert.reu13.df.to.list(ex.test$reu13.df) y.list <- convert.y.to.list(ex.test$y) n.list <- convert.n.to.list(ex.test$n) # Get phi.pred.Init init.function(model = "roc") fitlist <- fitMultinom(ex.train$reu13.df, ex.train$phi.Obs, ex.train$y, ex.train$n) phi.pred.Init <- estimatePhi(fitlist, reu13.list, y.list, n.list, E.Phi = median(ex.test$phi.Obs), lower.optim = min(ex.test$phi.Obs) * 0.9, upper.optim = max(ex.test$phi.Obs) * 1.1) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.