Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change interface ebpm_exponential_mixture to match ebnm_normal_scale_mixture #1

Open
stephens999 opened this issue Oct 4, 2019 · 1 comment

Comments

@stephens999
Copy link
Contributor

comments on
ebpm_exponential_mixture <- function(x,s,m = 2, grid = NULL, seed = 123)

we would like this to match:
ebnm_normal_scale_mixture <- function(x,
s = 1,
mode = 0,
scale = "estimate",
g_init = NULL,
fix_g = FALSE,
output = output_default(),
control = NULL)

x matches so that is ok.
s =1 just needs the default
mode - probably you don't need this for now as your code assumes mode=0
change "grid=NULL" to scale = "estimate".
seed , you don't need I think so can remove (the algorithm is deterministic)
control is to be passed to mixsqp - should be easy to implement

for g_init it seems you should introduce an exponentialmix class,
similar to this code for the laplacemix class from ebnm:

#' Constructor for laplacemix class
#'
#' Creates a finite mixture of Laplace distributions.
#'
#' @param pi A vector of mixture proportions.
#' @param mean A vector of means.
#' @param scale A vector of scale parameters.
#'
#' @export
#'
laplacemix <- function(pi, mean, scale) {
structure(data.frame(pi, mean, scale), class="laplacemix")
}

Probably you shoudl use "mode" instead of mean and set it to 0 since you only
use the 0 case for now?

@zihao12
Copy link
Collaborator

zihao12 commented Oct 19, 2019

It is updated now. I followed your advice except for the g_init. I used the class gammamix (pi, a, b) because all my code is written for gamma case as first, and I think it would be easier to extend to mixture of gamma later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants