stephens999 / ashr

An R package for adaptive shrinkage
GNU General Public License v3.0
79 stars 35 forks source link

example out of date #100

Closed stephens999 closed 5 years ago

stephens999 commented 5 years ago

@pcarbo

# Small example in which the interior-point method (implemented in
# MOSEK) yields negative mixture weights. These mixture weights are
# automatically set to zero and the weights are re-normalized. The
# EM algorithm does not suffer from this problem.
set.seed(1)
betahat <- c(8.115,9.027,9.289,10.097,9.463)
sebeta  <- c(0.6157,0.4129,0.3197,0.3920,0.5496)
fit.em  <- ash(betahat,sebeta,mixcompdist = "normal",optmethod = "mixEM")
fit.ip  <- ash(betahat,sebeta,mixcompdist = "normal",optmethod = "mixSQP")
youngseok-kim commented 5 years ago
fit.em  <- ash(betahat,sebeta,mixcompdist = "normal",optmethod = "mixEM")
fit.mixsqp  <- ash(betahat,sebeta,mixcompdist = "normal",optmethod = "mixSQP")
fit.ip  <- ash(betahat,sebeta,mixcompdist = "normal",optmethod = "mixIP")

The third one does not work.