admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

Small feature requests regarding parameter name outputs #262

Open Cole-Monnahan-NOAA opened 2 years ago

Cole-Monnahan-NOAA commented 2 years ago

I'd like to request two small additions. First is that during optimization, there is inconsistency in whether parameter numbers or names are reported.

For instance if there's a problem inverting the Hessian, the parameter number is printed here. Likewise when printing the sdreport variables a similar approach is taken here. It would be a big improvement to print the parameter names instead. The machinery for doing this for parameters is already developed as can be seen here in par_name. The sdreport variables will be slightly different. It's done here but doesn't include the vector index '[i]'. For instance output looks like this for a model:

Warning: Non-positive variance of sdreport variables: 423, 424, 425, 442, 452

where 423, 424, and 425 are the first three elements from a vector called slctfsh so should be outputted as slctfsh[1], slctfsh[2], slctfsh[3]. Note the value 423 comes from a vector of the parameters concatenated with the sdreport variables.

The second request is related to the parameter names as well. I need the active parameter names written to file even if the model fails to converge and produce a covariance matrix. These do get written to the .std file, but only if the Hessian is invertible. In cases when it's not, I still want these parameter names. I already modified admodel.hes to write the values here, could we also add the names on there as well? The same syntax as above, using [i] to denote vector element i, would be ideal.

So in short, could someone help me incorporate these minor changes in before the 13.0 release?

Thanks, Cole