Skip to contents

Transform a fitted distribution to represent data weighted by a different power of w

Usage

transform_fit(fit, power)

Arguments

fit

A fit data frame (one or more rows)

power

The power to raise the weights to

Value

An updated fit data frame

Examples

# Fit a normal distribution and transform to biomass weighting
fit <- fit_log_ppmr(barnes_data, "Albacore", distribution = "normal")
fit_biomass <- transform_fit(fit, power = 1)
fit_biomass
#>              mean       sd  species distribution power min_w_pred
#> Albacore 8.230995 1.146738 Albacore       normal     1          0

# Transform multiple species at once
fit2 <- fit_log_ppmr(barnes_data,
                     c("Albacore", "Atlantic cod"),
                     distribution = "normal")
transform_fit(fit2, power = 1)
#>                   mean       sd      species distribution power min_w_pred
#> Albacore      8.230995 1.146738     Albacore       normal     1          0
#> Atlantic cod -1.036782 2.600442 Atlantic cod       normal     1          0