s0_init.function: Initial Generic Functions of Codon Usage Bias Fits

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Initial generic functions for model fitting/approximation/prediction of cubfits.

Usage

1
2
3
4
5
6
7
8
  init.function(model = .CF.CT$model[1],
                type.p = .CF.CT$type.p[1],
                type.Phi = .CF.CT$type.Phi[1],
                model.Phi = .CF.CT$model.Phi[1],
                init.Phi = .CF.CT$init.Phi[1],
                init.fit = .CF.CT$init.fit[1],
                parallel = .CF.CT$parallel[1],
                adaptive = .CF.CT$adaptive[1])

Arguments

model

main fitted model.

type.p

proposal method for hyper-parameters.

type.Phi

proposal method for Phi (true expression values).

model.Phi

prior of Phi.

init.Phi

initial methods for Phi.

init.fit

how is coefficient initialed in vglm() of VGAM.

parallel

parallel functions.

adaptive

method for adaptive MCMC.

Details

This function mainly takes the options, find the according generic functions, and assign those functions to .cubfitsEnv. Those generic functions can be executed accordingly later within functions for MCMC or multinomial logistic regression such as cubfits(), cubappr(), and cubpred(). By default, those options are provided by .CF.CT which also leaves rooms for extensions of more complicated models and further optimizations.

It is supposed to call this function before running any MCMC or multinomial logistic regression. This function may affect cubfits(), cubpred(), cubappr(), estimatePhi(), and fitMultinom().

Value

Return an invisible object which is a list contain all generic functions according to the input options. All functions are also assigned in the .cubfitsEnv for later evaluations called by MCMC or multinomial logistic regression.

Note

Note that all options are taken default values from the global control object .CF.CT, so one can utilize/alter the object's values to adjust those affected functions.

Note that phi.Obs should be scaled to mean 1 before applying to MCMC.

Author(s)

Wei-Chen Chen wccsnow@gmail.com.

References

https://github.com/snoweye/cubfits/

See Also

.CF.CT, .CF.CT, cubfits(), cubpred(), and cubappr().

Examples

 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)

cubfits documentation built on Nov. 8, 2021, 1:07 a.m.