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

Add Contact Matrix and structure age in SEAIRQ Examples and death rate from the disease. #29

Closed
Mouvoh opened this issue May 6, 2020 · 10 comments

Comments

@Mouvoh
Copy link

Mouvoh commented May 6, 2020

Contact structure
Hello, for my traineeship I have to use the seairq model. I definitely understood the concept of age structure but I have some problems to catch the syntaxes of how import the data. For example in this SEAIRQ script. What should I do If I want to import the matrix contact ?

@Mouvoh
Copy link
Author

Mouvoh commented May 7, 2020

Contact structure 2
Contact structure 4
Contact structure 3

In order to improve my comprehension of the script I've been checking the SEIR Indian age structured but these 3 syntaxes are a bit difficult to understand. CH, CW, CS, are contact structure for House Work and school but please what are their values ? How can I modify them ?
Also Is_0[4:12]=3; Is_0[3:4]=1 does it mean 3 infected for the age classes numbered 4,5...12 ?
At last I do not really understand this syntax below :
for i in range(M):
IC += data['X'][:,3*M+i]

@rajeshrinet
Copy link
Owner

rajeshrinet commented May 7, 2020

@Mouvoh this is a good question. The contact matrices CH, CW, CS and CO have been obtained from a previous work by Prem et al: Projecting social contact matrices in 152 countries using contact surveys and demographic data, Kiesha Prem, Alex R. Cook, Mark Jit, PLOS Computational Biology, (2017)

As far as the code is concerned, you can use any contact matrix which is of the size M x M. In this example the contact matrix passed for the integration is a simple sum,

C = CH+CW+CS+CO.

You could use

C = aH*CH+aW*CW+aS*CS+aO*CO.

Then vary the constants aH, aW, aS, aO...

See also examples in the folder contactMatrix and control at https://github.com/rajeshrinet/pyross/tree/master/examples.

Yes, Is_0[4:12]=3 mean 3 infected for the age classes numbered 4,5...11 at the start of the simulation.

The data for the SEIR model is stored as: first M points is S, then E, then Ia and then Is. So if you want to plot Is, you need to see points starting from 3*M. If you are interested in the net number of infections, then you have to sum it over all M age-groups. This is done by

for i in range(M):
    IC += data['X'][:,3*M+i]

Hope this is helpful.

@Mouvoh
Copy link
Author

Mouvoh commented May 7, 2020

Thanks, all has been clarified but the first point is still misunderstood. After some research, I found the studies about contact Matrix I guess it has some empiric values. But in the script I see pyross.contactMatrix.(The country)() so where are theses contact matrix in the different folders ? what if I want for example for France which file should I import in the database ?

rajeshrinet added a commit that referenced this issue May 7, 2020
@rajeshrinet
Copy link
Owner

@Mouvoh you can now import contacts matrices for France as

import pyross
CH, CW, CS, CO = pyross.contactMatrix.France()     

To do it for some other country:

import pandas as pd
import numpy as np
CW=np.array(pd.read_excel(os.path.join(curDir,'data/contact_matrices_152_countries/MUestimates_work_1.xlsx'), sheet_name='France'))

here curDir is the path of the pyross/examples folder

@Mouvoh
Copy link
Author

Mouvoh commented May 7, 2020

Thanks a lot

@Mouvoh
Copy link
Author

Mouvoh commented May 7, 2020

Re Hello, thanks to you I made a lot of things since the beginning. About the covid-cases is there a syntax to import for any countries ? Because I've been on the site worlmeters but the data are not shaped as in the pyross data.
Also about CW=np.array(pd.read_excel(os.path.join(curDir,'data/contact_matrices_152_countries/MUestimates_work_1.xlsx'), sheet_name='France')), do I do the same for CH , CS & CO ?

@rajeshrinet
Copy link
Owner

Yes, you do the same for CH, CS, CO.

@Mouvoh

This comment has been minimized.

@Mouvoh
Copy link
Author

Mouvoh commented May 9, 2020

Capture d’écran de 2020-05-09 12-03-50
image
Requirement already satisfied: pytz in /home/kazuki/anaconda3/lib/python3.7/site-packages (2020.1)
Please I am now in my pyross environment but havaing an issue with panda. I do not know why there is an error because i installed this module in my pyross environment once this issue raised. I see the issue come from Python 3.8

@Mouvoh
Copy link
Author

Mouvoh commented May 9, 2020

Solved just put import panda before pyross

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

2 participants