Add first pass of OSA residuals#3
Open
Cole-Monnahan-NOAA wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements one-step-ahead residuals for observed data families except "binomial" and "fixed." The former could be implemented using a
pbetaapproach as in other applications, e.g., here.OSA residuals can be determined as normal by calling
TMB::oneStepPredict(fit$obj, data.term.indicator='keep', observation.name='y_k2')where
fitis returned by thedsemfunction, and selecting one of the available methods (see?oneStepPredict). The 'cdf' method is probably the best choice although for fast models the 'oneStepGeneric' should provide more accurate estimates. Note that residuals make no sense for "fixed" family and if the observation error is estimated to be very small it will likely fail as well.All tests passed and the package and vignettes were built locally without issue, but should be considered an experimental feature for now. Further testing would be prudent, in particular comparing an equivalent model to a existing framework with OSA implemented to ensure they match and thus confirm it has been correctly coded in
dsem.