beta_get_shape_params: Calculate the two shape parameters from the mean ('mu') and...

View source: R/utils-beta.R

beta_get_shape_paramsR Documentation

Calculate the two shape parameters from the mean (mu) and cv which is what is in the SS files.

Description

Calculate the two shape parameters from the mean (mu) and cv which is what is in the SS files.

Usage

beta_get_shape_params(mu, cv)

Arguments

mu

The mean of the Beta distribution

cv

The CV of the Beta distribution

Details

To make a plot of the Beta function based on values from SS3 which are labelled prior and pr_sd in the control file, do this: s1 <- beta_get_shape_params(prior, pr_sd)[1] s2 <- beta_get_shape_params(prior, pr_sd)[2] ⁠ggplot() +⁠ ⁠geom_function(fun = stats::dbeta,⁠ ⁠args = list(shape1 = s1, shape2 = s2, log = FALSE))⁠

Value

A vector of two values, the two shape parameters, also know as shape1 and shape2 by the stats::dbeta() function


pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.