Description Usage Arguments Details Value Author(s) References See Also Examples
This generic function estimates Phi (expression value) either by posterior
mean (PM) or by maximum likelihood estimator (MLE) depending on options set
by init.function()
.
1 2 3 4 5 | estimatePhi(fitlist, reu13.list, y.list, n.list,
E.Phi = .CF.OP$E.Phi, lower.optim = .CF.OP$lower.optim,
upper.optim = .CF.OP$upper.optim,
lower.integrate = .CF.OP$lower.integrate,
upper.integrate = .CF.OP$upper.integrate, control = list())
|
fitlist |
an object of format |
reu13.list |
an object of format |
y.list |
an object of format |
n.list |
an object of format |
E.Phi |
potential expected value of Phi. |
lower.optim |
lower bound to |
upper.optim |
upper bound to |
lower.integrate |
lower bound to |
upper.integrate |
upper bound to |
control |
control options to |
estimatePhi()
is a generic function first initialized by
init.function()
, then it estimates Phi accordingly.
By default, .CF.CT$init.Phi
sets the method PM
for the
posterior mean.
PM
uses a flat prior and integrate()
to estimate
Phi. While, MLE
uses optim()
to estimate Phi which
may have boundary solutions for some sequences.
Estimated Phi for every sequence is returned.
Wei-Chen Chen wccsnow@gmail.com.
https://github.com/snoweye/cubfits/
init.function()
and fitMultinom()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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.