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

Aggregate expected obs #251

Closed
seabbs opened this issue Jun 3, 2024 · 1 comment · Fixed by #397
Closed

Aggregate expected obs #251

seabbs opened this issue Jun 3, 2024 · 1 comment · Fixed by #397
Labels
enhancement New feature or request EpiAware

Comments

@seabbs
Copy link
Collaborator

seabbs commented Jun 3, 2024

To support aggregating obs from daily to other timescales we likely want to have a struct called Aggregate that mirrors Ascertainment but allows for aggregating expected observations

This would allow for fitting to weekly data etc.

Another option here which would require less code would be to relax te constraint in LatentDelay that enforces the static PMF to be proper.

@seabbs
Copy link
Collaborator Author

seabbs commented Jul 19, 2024

You could potentially handle this like broadcasting and change the shape of the data but I don't think we want to go this way as it will make composability confusing.

We might want to specify slightly more complex structures (i.e o enforce once a week reporting without duplication of aggregation and this would suggest we do want a Aggregate struct vs relying on latent delay.

Something like:

struct Aggregate
     model
     aggregation = [0, 7, 0, 0, 0, 0, 0]
end

generate_observations(::Aggregate, y_t, Y_t)
	 aggregation = fill(aggregation, length(Y_t)) #broadcast out by repeating pseudo code
   
  	 exp_Y_t = map(eachindex(aggregation)) do i
			exp_Y_t = sum(Y_t[min(1, i - aggrgation[i] + 1)])
  	end
  	@submodel y_t = generate_observations(model, y_t, exp_Y_t)
  	return y_t
end

This would work but would be quite wasteful in that it would have lots of downstream processing still occurring to 0. We could instead manipulate both the expected data and the actual observations here (i.e pull out the aggregation targets and pass them down and then reconstruct y_t here before returning. That could have some potential ramifications though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request EpiAware
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant