v1xerunt/STAN

Cummulative sum

Closed this issue · 2 comments

Hi!

First of all I want to congratulate you on the great work! You did a great analysis and have thorough experiments on your paper.

We are using your model to conduct experiments with Portuguese covid data. For this we used the code provided in the notebook that is in this repo. I have some questions about the retrieval of the results done in the notebook:

  • I understand that we need to scale the values back to the original distribution with the scale and mean shift. But after that you perform a cummulative sum with the np.cumsum function. Why do we need to do this?
  • After the np.cumsum line, there is a shift based on the last day of the input, i.e. last_I. Wouldn't this be redundant if we used the test_pred_phy_active? In other words, the output of stan that includes the dynamics?
  • Based on the latter question, why don't you also shift the new_I output of the STAN model? Just as you do with phy_I in lines

    STAN/model.py

    Line 124 in 12628a3

    last_I = I[each_step] if i == 0 else last_I + dI.detach()

Sorry for all the questions. We are trying to perform experiments in Portugal and we are not able to replicate your observations with the US data.

Best,
David

Hi David,

  1. The model prediction is daily new cases, and we want to get the total infected cases in the prediction window, so we use cumsum to add daily numbers and get the total cases.
  2. The shift is to add the total new infected cases in the prediction window (dI) to the existing case number. I think it should be redundant if you use test_pred_phy_active. But in the model we don't use test_pred_phy_active as final prediction. We always use pred_I as prediction results.
  3. In SIR, the number of infected cases I is the total active cases, but our prediction last_I is the daily new cases, so we need to add it to the existing case number.

Sorry I don't remember exactly about these details as it has been years. Please ask if you have any other questions. If you are looking for a spatio-temporal model, I suggest you check our another work HOIST (https://github.com/v1xerunt/HOIST). We found it is better than STAN.

Thank you so much for the quick reply. You were extremely helpful!