-
Notifications
You must be signed in to change notification settings - Fork 231
Open
Description
Turing.jl/src/optimisation/Optimisation.jl
Lines 223 to 237 in 4dc7ad0
| function StatsBase.informationmatrix( | |
| m::ModeResult; hessian_function=ForwardDiff.hessian, kwargs... | |
| ) | |
| # This needs to be calculated in unlinked space | |
| model = m.f.ldf.model | |
| vi = DynamicPPL.VarInfo(model) | |
| getlogdensity = _choose_getlogdensity(m.estimator) | |
| new_optimld = OptimLogDensity(DynamicPPL.LogDensityFunction(model, getlogdensity, vi)) | |
| # Calculate the Hessian, which is the information matrix because the negative of the log | |
| # likelihood was optimized | |
| varnames = StatsBase.coefnames(m) | |
| info = hessian_function(new_optimld, m.values.array[:, 1]) | |
| return NamedArrays.NamedArray(info, (varnames, varnames)) | |
| end |
this should take an adtype rather than a hessian function
Metadata
Metadata
Assignees
Labels
No labels