With dense isochrone grids (> 1000 isochrones) the primary compute time for SFH optimization is spent in the composite! function doing the linear algebra to build the composite model. In fixed_amr, relative weights due to age-metallicity relations and metallicity distribution functions are fixed at runtime and the only optimization parameters are effectively star formation rates. As such, we could exclude isochrones with very low relative weights from the computation at runtime with (hopefully) minimal impact on convergence / quality of the fits. I'm thinking of adding a keyword argument, something like relweightcut, such that when considering the set of all relative weights aweights for isochrones of age a, isochrones with aweights[i] <= relweightcut * maximum(aweights) would be excluded from the composite model. With grids that are quite wide in metallicity-space this could lead to speedups ~2-5x. Thinking default should be for this behavior to be disabled, but it's a nice feature for applications where you might run fixed_amr many times in a loop (i.e., Monte Carlo applications) as long as it doesn't impact accuracy significantly.
In principle this could additionally be implemented into methods that fit the age-metallicity relation but you would have to redefine the selection in every loop iteration, and since the metallicity parameters are now being fit I worry that truncating the isochrone list could lead to instability or inaccuracy, so this application is low-priority.
With dense isochrone grids (> 1000 isochrones) the primary compute time for SFH optimization is spent in the
composite!
function doing the linear algebra to build the composite model. Infixed_amr
, relative weights due to age-metallicity relations and metallicity distribution functions are fixed at runtime and the only optimization parameters are effectively star formation rates. As such, we could exclude isochrones with very low relative weights from the computation at runtime with (hopefully) minimal impact on convergence / quality of the fits. I'm thinking of adding a keyword argument, something likerelweightcut
, such that when considering the set of all relative weightsaweights
for isochrones of agea
, isochrones withaweights[i] <= relweightcut * maximum(aweights)
would be excluded from the composite model. With grids that are quite wide in metallicity-space this could lead to speedups ~2-5x. Thinking default should be for this behavior to be disabled, but it's a nice feature for applications where you might runfixed_amr
many times in a loop (i.e., Monte Carlo applications) as long as it doesn't impact accuracy significantly.In principle this could additionally be implemented into methods that fit the age-metallicity relation but you would have to redefine the selection in every loop iteration, and since the metallicity parameters are now being fit I worry that truncating the isochrone list could lead to instability or inaccuracy, so this application is low-priority.