Skip to content

chambers-yamasaki submission#6

Open
ayamasaki2011 wants to merge 13 commits into
lyy005:masterfrom
ayamasaki2011:master
Open

chambers-yamasaki submission#6
ayamasaki2011 wants to merge 13 commits into
lyy005:masterfrom
ayamasaki2011:master

Conversation

@ayamasaki2011

Copy link
Copy Markdown

No description provided.

Comment thread Ex10_Answers.py
rates=rates+geom_line(store_rs,aes(y="r4"))
rates=rates+geom_line(store_rs,aes(y="r5"))

rates #Display the graph

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.

Good job! If you want to color code each line, you can use:
ggplot(store_rs,aes(x="time",y="r1",color="10"))+geom_line(store_rs,aes(y="r2",color="50"))+geom_line(store_rs,aes(y="r3",color="100"))

Comment thread Ex10_Answers.py

plt.figure(figsize=[6,4])
plt.plot(t, solution[:, 0], label="S(t)")
plt.plot(t, solution[:, 1], label="I(t)")

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.

What is the use of variable "solution" here?

Comment thread Ex10_Answers.py
print("BasicReproductionNumber")
print(basicReproductionNumber)

print("!!! please see file named README for analysis completing question 2 !!!")

@lyy005 lyy005 Nov 27, 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.

storeSIR=pandas.DataFrame({"beta":beta,"gamma":gamma,"R0":beta*sum(y0)/gamma,"maxIncidence":0,"maxPrevalence":0,"percentAffected":0}) . # make the data frame to store the three calculations

for i in range(0,len(betas)):
pars=(beta[i],gamma[i]) # loop through betas and gammas
sim=si.odeint(func=simSIR,y0=y0,t=times,args=pars) . # simulates SIRs
storeSIR.iloc[i,4]=numpy.max(sim[:,1]/numpy.sum(sim,axis=1)) # calculates the max prevalence
storeSIR.iloc[i,3]=numpy.max(sim[1:len(sim),1]-sim[0:(len(sim)-1),1]) # calculates the max incidence
storeSIR.iloc[i,5]=numpy.sum(sim[len(sim)-1,1:3])/numpy.sum(sim[len(sim)-1,:])*100 # calculates the max percentat affected

-0.25 pts

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