gadget-framework / gadget3

TMB-based gadget implemtation
GNU General Public License v2.0
8 stars 6 forks source link

Mean of first/last 5 values for missing values g3_param_table() #103

Open lentinj opened 1 year ago

lentinj commented 1 year ago

It'd be nice to be able to say "mean(i)" for ifmissing, i.e. get the mean of i values either from the start or end, depending on which end you fell off. Possibly this should even be the default, for projection / hindcast it'd be the most obvious thing to do.

Whilst this could be relatively easily implemented in C++ (which uses a std::map with an ordering), R doesn't have anything like that available, possibly a condition would have to be generated at compile time?

lentinj commented 1 year ago

@bthe @willbutler42 The above stops ifmissing being a fatal error at least, so you can at least find these problems without resorting to gdbsource().