You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
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?
The text was updated successfully, but these errors were encountered: