Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lentinj opened this issue Jan 27, 2023 · 1 comment
Open

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

lentinj opened this issue Jan 27, 2023 · 1 comment

Comments

@lentinj
Copy link
Collaborator

lentinj commented Jan 27, 2023

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 added a commit that referenced this issue Jan 27, 2023
The default runtime_error() will crash the R session under TMB, which
is less than friendly. Return NaN with a warning in the console
instead.

Whilst not the ideal of selecting first/last values as a default, it's
an improvement.
lentinj added a commit that referenced this issue Jan 27, 2023
The default runtime_error() will crash the R session under TMB, which
is less than friendly. Return NaN with a warning in the console
instead.

Whilst not the ideal of selecting first/last values as a default, it's
an improvement.
@lentinj
Copy link
Collaborator Author

lentinj commented Jan 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant