Skip to content

Burton-Doherty Submission#9

Open
pdoherty31 wants to merge 2 commits into
lyy005:masterfrom
pdoherty31:master
Open

Burton-Doherty Submission#9
pdoherty31 wants to merge 2 commits into
lyy005:masterfrom
pdoherty31:master

Conversation

@pdoherty31

Copy link
Copy Markdown

No description provided.

Comment thread Ex10.1.py
ms1=spint.odeint(func=mgrate,y0=N0,t=times,args=param1)
modelOutput=pandas.DataFrame({"t":times,"N":ms1[:,0]})
mgraph=ggplot(modelOutput,aes(x="t",y="N"))+geom_line()+theme_classic()

@lyy005 lyy005 Nov 28, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to put the following two lines in the loop to store the results
ms1=spint.odeint(func=mgrate,y0=N0,t=times,args=param1)
modelOutput=pandas.DataFrame({"t":times,"N":ms1[:,0]})

-0.1 pts

Comment thread Ex10_2.py
S=y[0]
I=y[0]
R=y[0]

@lyy005 lyy005 Nov 28, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I=y[1]
R=y[2]

Comment thread Ex10_2.py
plot_1=ggplot(simDF_1,aes(x="t", y="S"))+geom_line(color='blue')+geom_line(simDF_1,aes(x="t",y="I"), color='red')+ geom_line(simDF_1,aes(x="t",y="R"), color='green')+theme_classic()
plot_1
#maximum daily incidence is 292.26, occuring between day 0 and 1
max(simDF_1.iloc[:,0])

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simulation is good. The max daily incidence should be:
numpy.max(sim[1:len(sim),1]-sim[0:(len(sim)-1),1])

Comment thread Ex10_2.py
max(simDF_1.iloc[:,0])
#max prevalence is 669.84
percent_infected_1=100*(1000-simDF_1.iloc[499,2])/1000
print(percent_infected_1)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The percentage infected should be:
numpy.sum(sim[len(sim)-1,1:3])/numpy.sum(sim[len(sim)-1,:])*100

Comment thread Ex10_2.py
sim=spint.odeint(func=diseaseSim,y0=y0,t=times,args=params)
simDF_8=pd.DataFrame({"t":times,"S":sim[:,0],"I":sim[:,1],"R":sim[:,2]})
plot_8=ggplot(simDF_8,aes(x="t", y="S"))+geom_line(color='blue')+geom_line(simDF_8,aes(x="t",y="I"), color='red')+ geom_line(simDF_8,aes(x="t",y="R"), color='green')+theme_classic()
plot_8

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, you guys did a good job. Just need some minor changes in the model and the calculation of the parameters. Good job!

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

Successfully merging this pull request may close these issues.

3 participants