neg_log_likelihood_lognormal: Calculate negative log-likelihood for log-normal weight...

View source: R/14.2.5-strategy-mle.R

neg_log_likelihood_lognormalR Documentation

Calculate negative log-likelihood for log-normal weight observations

Description

Calculates the negative log-likelihood for observed final weights assuming they follow a log-normal distribution around the predicted weight. Consistent with the TMB backend implementation.

Usage

neg_log_likelihood_lognormal(params, observed_weights, simulation_function)

Arguments

params

Vector of parameters to estimate: - params[1]: p_value (feeding level, 0.01-5.0) - params[2]: log(sigma) (log of standard deviation of log-weights)

observed_weights

Numeric vector of observed final weights (g)

simulation_function

Function that takes p_value and returns predicted weight

Value

Negative log-likelihood value (scalar)


fb4package documentation built on May 8, 2026, 1:07 a.m.