R/parameter_names.R

Defines functions parameter_name_R parameter_name_tf

#------------------------------------------------------------------------
# Parameters names from R to TF -----------------------------------------
#------------------------------------------------------------------------
parameter_name_tf <- function(parameter, distribution) {

        list_dist <- c("Poisson", "LogNormal")
        if (distribution %in% list_dist) {
                listparam <- list(lambda = "lambda",
                                  meanlog = "log",
                                  sdlog = "scale")
        } else if (distribution == "FWE") {
                listparam <- list(mu = "mu",
                                  sigma = "sigma")
        } else {
                listparam <- list(mean = "mean",
                                  sd = "sd",
                                  shape = "shape",
                                  rate = "rate",
                                  scale = "scale",
                                  shape1 = "shape1",
                                  shape2 = "shape2",
                                  size = "total_count",
                                  prob = "probs")
        }


        return(listparam[[parameter]])
}

#------------------------------------------------------------------------
# Parameters names from TF to R -----------------------------------------
#------------------------------------------------------------------------
parameter_name_R <- function(parameter, distribution) {

        list_dist <- c("Poisson", "LogNormal")
        if (distribution %in% list_dist) {
                listparam <- list(lambda = "lambda",
                                  meanlog = "meanlog",
                                  sdlog = "sdlog")
        } else if (distribution == "FWE") {
                listparam <- list(mu = "mu",
                                  sigma = "sigma")
        } else {
                listparam <- list(mean = "mean",
                                  sd = "sd",
                                  shape = "shape",
                                  rate = "rate",
                                  scale = "scale",
                                  shape1 = "shape1",
                                  shape2 = "shape2",
                                  total_count = "total_count",
                                  probs = "probs")
        }

        return(listparam[[parameter]])
}
SaraGarcesCespedes/estimtf documentation built on Nov. 7, 2021, 10:29 p.m.