Open swihart opened 6 years ago
Focus: bridge distribution.
Use the scratch code you have as a guide and keep record here of where you needed to add bridge (remember, switch() doesn't use quotations marks...)
DESCRIPTION
Imports
: bridgedist@param mixture
(adjust the last two sentences as well)@pmix
as to whether it is scale, or variancematch.arg
:
mixture <- match.arg(mixture, c("logit-bridge", "normal", "logistic", "Cauchy",
"Laplace", "gamma", "inverse gamma", "inverse Gauss",
"Weibull", "Levy", "beta", "simplex", "two-sided power"))
switch(mixture
(be sure to use :: since DESCRIPTION
is using Imports
):
mix <- switch(mixture,
"logit-bridge" = function(p, r) bridgedist::dbridge(r, 1/sqrt(1+3/pi^2*p)),
normal=function(p,r) dnorm(r,0,sqrt(p)),
logistic=function(p,r) dlogis(r,0,p*sqrt(3)/pi),
<...snip...>
)
# combine to create the appropriate likelihood function
#
if(mixture=="logit-bridge"||mixture=="normal"||mixture=="logistic"||mixture=="Cauchy" <...snip...>)
When ready for libstableR:
https://github.com/hadley/devtools/blob/master/vignettes/dependencies.Rmd
see gmail for what you want to post here
in:draft before:2017/11/01 after:2017/8/31
went ahead and did "logit-bridge-var" and "logit-bridge-phi" which will come in handy later. Do the same for normal and cauchy. Super easy, just follow the logit-bridge places to edit above.
Just completed the "normal-var" (default for mixture
), "normal-phi", "Cauchy-scl", and "Cauchy-phi" for gnlrim. Have some working examples in scratch_testing.R. I also built in a if{}else{} for the optimx call...if method is the default, that is nlminb
and only nlminb
then I don't pass the nlm arguments ... I was getting sick of the warnings about ignoring them and an attempt to use optimx's "dowarn" did not work.
We've come to this.
Keep in mind, the easiest ones will be those that have only parameter, the disp parameter.
For others that have two parameters, we will need to elongate pmix, and be careful of what order pmix is specified, etc. We will make a separate issue for these.
For now, let's do:
The others are stable (which needs alpha, gamma) and cloglog bridge (which needs alpha, delta).
cloglog needs a stable distribution. Might want to include flag that will toggle between libstableR and stabledist. Along with a note for github libstableR on macOS. Or better yet, make it depend on Bob's github repo...