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.
neg_log_likelihood_lognormal(params, observed_weights, simulation_function)Negative log-likelihood value (scalar)
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)
Numeric vector of observed final weights (g)
Function that takes p_value and returns predicted weight