Performs Gauss-Newton optimisation of the variational free energy for a
non-linear forward model with Gaussian priors. Mirrors SPM25's
dcm_nlsi_GN.
dcm_nlsi_GN(M, U, Y)List with posterior expectation Ep, covariance Cp,
log-precision estimate Eh, free energy F, and components.
Most users should call dcm_estimate instead, which assembles
M, U and Y from a DCM specification and calls this
function. Use dcm_nlsi_GN directly only to invert a non-linear
model that is not an fMRI DCM.
Progress is reported per Gauss-Newton iteration as
EM:(+) k F: ..., where (+) marks an accepted step and
(-) a rejected one. Set M$noprint <- 1 to silence it.
dcm_estimate for the user-facing entry point.
# Inverting even the small bundled model runs the full Gauss-Newton loop
# (roughly 75 seconds), so this is not run automatically.
if (FALSE) { # \dontrun{
data(toy_dcm)
# The easy route (dcm_estimate builds M, U and Y for you):
fit <- dcm_estimate(toy_dcm)
fit$F
# dcm_nlsi_GN is what it calls underneath, and returns the same
# posterior fields:
str(fit$Ep, max.level = 1)
} # }