
Log-density of many observations under many parameter values
Source:R/likelihood.R
de_log_lik_iid.RdThe cross product n_theta x n_obs, in standardized space. Only
sum_iid = FALSE wants that matrix; everything else – log_lik()'s default
and every MCMC step – wants its row sums, and gets them from
de_iid_evaluator() without ever building it.
Details
The default expands the cross product and makes one batched call, which is
what a flow needs: its transforms depend on the observation as well as the
parameter, so there is nothing to reuse between observations. Estimators
whose conditional distribution depends on the parameter alone – the MDN
and the linear-Gaussian baseline – override this and compute that
distribution once per parameter, which turns the i.i.d. sum from
n_theta * n_obs network passes into n_theta of them. With a few thousand
observations that is the difference between usable and not.