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

"one step ahead" predictions to assess the fit to data #63

Open
lentinj opened this issue Jun 9, 2022 · 3 comments
Open

"one step ahead" predictions to assess the fit to data #63

lentinj opened this issue Jun 9, 2022 · 3 comments

Comments

@lentinj
Copy link
Collaborator

lentinj commented Jun 9, 2022

Support the use of TMB::oneStepPredict() in gadget3-generated models. This
will require the addition of an “indicator variable”, with the same dimensions as the
observations array, used to turn individual observations on/off when calculating
likelihood. Add examples to the demo-ling model to show how it could be used.

@lentinj
Copy link
Collaborator Author

lentinj commented Jun 22, 2022

It's not the same dimensions as the observations array, it's the same dimensions of nllstock, i.e. if broken down by model timestep a on/off switch at each timestep.

This means all previous concerns about on/offing nonsense dimensions go out the window. nllstock is at most a vector over time.

This is nonsense. Then it doesn't match the observations array, which is the whole point.

@lentinj
Copy link
Collaborator Author

lentinj commented Jun 23, 2022

The main decision left here is how it's off-on'ed. We can just add it everywhere but doing so creates a useless array of 1's.

However, adding explicit "indicator_var" booleans to g3l_distribution_sumofsquares and friends would be a bit annoying to (forget to) off/on when required.

lentinj added a commit that referenced this issue Jun 23, 2022
Modify distribution functions to include a keep, which gets plumbed in
as a DATA_ARRAY_INDICATOR into our model.

This should in theory work, however:-

* We need to be able to off/on the keep support, otherwise it clogs up
models with unnecessary arrays of 1.

* TMB::oneStepPredict seemingly has no concept of array stride,
without I'm not sure how we might off/on e.g. all length observations
for a single timestep. Without we're not convinced this is very useful.
@lentinj
Copy link
Collaborator Author

lentinj commented Jun 23, 2022

An attempt at doing this is in the commit above. Parking this for now until we've worked out how to turn on/off for an entire timestep in one go

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