You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user passes in two vectors of equal length: one representing the observed dates (dates_obs_hospital_admissions, dates_obs_ed_visits, etc) and one representing the observed values (values_obs_hospital_admissions, values_obs_ed_visits etc).
Model generates predictions for all dates from the earliest observation date across signals to the last observation date across signals, but only performs the observation process for the user-specified observed dates for each signal.
Details
Model determines what date corresponds to model $t_0$. By convention, this is the date of the first observation across all available signals. Note that some vectors in the model will not begin at $t_0$including the vector of infections. This should be a @property (named model_t0_date) of PyrenewHEWData
Model determines the model time indices (rel to $t_0$, zero indexed) of the observed dates for all three signals. This should be a class method of PyrenewHEWData (named, e.g. date_to_model_time()) that uses the value of model_t0_date to perform the computation. Name these vectors model_t_obs_hospital_admissions, model_t_obs_ed_visits etc.
Model computes the latent_infections vector. Model computes the time index of the first entry of the latent_infections vector (in model time, i.e. relative to $t_0$. It will be negative.
Model computes the predicted signal value vectors (i.e. latent_hospital_admissions, latent_ed_visits, etc.) via the compute_delay_ascertained_incidence() or wastewater equivalent. Model uses offsets of the start of these predicted signal vectors relative to the latent_infections vector to compute the (integer) time indices in model time of those vectors' first entries (model_t_first_latent_ed_visit, etc).
Model indexes latent_{signal} vectors by model_t_obs_{signal} vectors with the appropriate offset given by model_t_first_latent_{signal} integer, and performs the observation, e.g.
which_obs_ed_visits=model_t_obs_ed_visits-model_t_first_latent_ed_visit# minus because the first entry of the latent_ed_visits vector corresponds to model_t >= 0observed_ed_visits_admissions=ed_visits_obs_rv(
mu=latent_ed_visits[which_obs_ed_visits],
obs=data_observed_ed_visits,
)
For posterior prediction (including forecasting), indexing by which_obs_{signal} should return all the values of latent_{signal} (i.e. which_obs_{signal} should be the vector range(latent_{signal}.size) and data_observed_{signal} should be None. The to_forecast_data() method of PyrenewHEWData should be configured accordingly.
The text was updated successfully, but these errors were encountered:
Needs
To-do once implemeneted
What exists
Right now, H and E expect complete timeseries (i.e. no missing observations) and are keyed by a first observation date:
pyrenew-hew/pyrenew_hew/pyrenew_hew_model.py
Lines 513 to 516 in 85b13d8
W, in contrast, has nullable data, and takes an explicit vector of observed times:
pyrenew-hew/pyrenew_hew/pyrenew_hew_model.py
Lines 703 to 706 in 85b13d8
What we want
The same system for H and E as W
dates_obs_hospital_admissions
,dates_obs_ed_visits
, etc) and one representing the observed values (values_obs_hospital_admissions
,values_obs_ed_visits
etc).Details
Model determines what date corresponds to model$t_0$ . By convention, this is the date of the first observation across all available signals. Note that some vectors in the model will not begin at $t_0$ including the vector of infections. This should be a
@property
(namedmodel_t0_date
) ofPyrenewHEWData
Model determines the model time indices (rel to$t_0$ , zero indexed) of the observed dates for all three signals. This should be a class method of
PyrenewHEWData
(named, e.g.date_to_model_time()
) that uses the value ofmodel_t0_date
to perform the computation. Name these vectorsmodel_t_obs_hospital_admissions
,model_t_obs_ed_visits
etc.Model computes the$t_0$ . It will be negative.
latent_infections
vector. Model computes the time index of the first entry of thelatent_infections
vector (in model time, i.e. relative toModel computes the predicted signal value vectors (i.e.
latent_hospital_admissions
,latent_ed_visits
, etc.) via thecompute_delay_ascertained_incidence()
or wastewater equivalent. Model uses offsets of the start of these predicted signal vectors relative to thelatent_infections
vector to compute the (integer) time indices in model time of those vectors' first entries (model_t_first_latent_ed_visit
, etc).Model indexes
latent_{signal}
vectors bymodel_t_obs_{signal}
vectors with the appropriate offset given bymodel_t_first_latent_{signal}
integer, and performs the observation, e.g.which_obs_{signal}
should return all the values oflatent_{signal}
(i.e.which_obs_{signal}
should be the vectorrange(latent_{signal}.size
) anddata_observed_{signal}
should beNone
. Theto_forecast_data()
method ofPyrenewHEWData
should be configured accordingly.The text was updated successfully, but these errors were encountered: