Each new loss function needs to include both computation of the loss and the simulation of observation error. These are here in the negative binomial case:
Notes: because this is the log normal distribution, you need to first log-transform the observed variable before passing it to the x argument of dnorm and log-transform the simulated variable before passing it to the mean argument of dnorm and mu argument of rnorm
Including the existing negative binomial loss function, please ensure that the following loss functions are available with the following loss IDs.
test case
Each new loss function needs to include both computation of the loss and the simulation of observation error. These are here in the negative binomial case:
Negative Binomial
Exists already as
case = 0
Poisson
case = 1
loss_param_count=0
Log Normal
case = 2
x
argument ofdnorm
and log-transform the simulated variable before passing it to themean
argument ofdnorm
andmu
argument ofrnorm
Normal
case = 3
Beta
case = 4
loss_param_count=2