R/fit_distributions.R
generate_cost_function.Rd
This is an internal helper function that generates a sum of squares
cost function for any given r*
function (e.g. rnorm, rlognorm). The
resulting function is intended to be used by an optim
call for fitting
quantiles to distribution parameters.
generate_cost_function(func)
func | A distribution function. |
---|
A function.
Other distribution fitting functions:
combine_lognorm_trunc()
,
combine_lognorm()
,
combine_norm()
,
fit_capabilities_geomean()
,
fit_capabilities()
,
fit_lognorm_trunc()
,
fit_lognorm()
,
fit_norm_trunc()
,
fit_pois()
,
fit_scenarios_geomean()
,
fit_scenarios()
,
fit_threat_communities()
,
lognormal_to_normal()
,
normal_to_lognormal()
#> function (x, quant, est, ...) #> { #> x1 <- x[1] #> x2 <- x[2] #> if (x1 < 0 | x2 < 0) #> return(NA) #> sum(((rlang::get_expr(func))(quant, x1, x2, ...) - est)^2) #> } #> <bytecode: 0x7feca5b7d838> #> <environment: 0x7fec871cca90>