create account

Corona data analysis, automising .exe with python and statistical rethinking by mathowl

View this thread on: hive.blogpeakd.comecency.com
· @mathowl · (edited)
$10.61
Corona data analysis, automising .exe with python and statistical rethinking
Did a couple of fun sciencey things. Probably can go back to work in March. In the meantime, learn, discover and create more :o)

## Corona data analysis
For a [previous post](https://steemit.com/steemstem/@mathowl/data-analysis-on-corona-spread-in-china-1-22-2-08) I had a look at the underlying function driving the corona spread. I got an excellent fit to a quadratic function:
<center>
![corona_spread.jpg](https://cdn.steemitimages.com/DQmVcoUWz38S8HRstfqDcKft6zKDL4mGJV2nvx9TsWWdS4L/corona_spread.jpg)
</center>
The definition of being infected has been redefined in the meantime so it certainly doesn't match the current data. But there is still the relevant question of why the newly infected cases follows a quadratic polynomial. I have a nice heuristic argument for this.  

**Heuristics!** So I assume (which is a big assumption) that the actual number of people with the virus is much greater than the confirmed cases. This means that the graph above gives an estimate of how many people can be confirmed to have the virus, which requires medical test. View medical test as a resource which needs to be sent to a location. Suppose an idealized setting where resources are spread out uniform, the location to which they need to be send is a point and travel speed is a constant. Then,  the resources at that point will be a quadratic function in time since the area of a circle is quadratic with respect to the radius.  

**And a note.** Heuristic/Qualitative reasons should always be viewed critically because they never come with error bounds, likelihood functions etc.  In the real world everything works with quantitative stuff so never fully trust when somebody cannot provide a quantative reason backed by real data. Also note that people who think that long term extrapolation is useful without understanding the underlying dynamics are stupid. Only do it for fun :P. So here is how long it will take before everybody gets the virus (based on 17 data points)

<center>
![corona_spread_extinction.jpg](https://cdn.steemitimages.com/DQmbndDnqqQBaL6N63rFkbBW2nAx1NoNbqNC7sBT9MbUrZt/corona_spread_extinction.jpg)
</center>


lol 25 years :P

## Automising exe with python
In China I use a VPN. Sometimes there is no connection from a VPN location so then you have to switch location.  This doesn't go automatic :(  In addition, when the VPN cannot connect it will timeout after a couple of minutes.  :( Anyway, Python to rescue because there is this lovely module called [``pywinauto``](https://github.com/pywinauto/pywinauto) which can automise .exe stuff on your windows machine. It runs on python 3.3 to 3.7.4 for later version it [doesn't seem to work](https://github.com/pywinauto/pywinauto/issues/800) . Also, when installing keep in mind that you need to run in the same bits as in the exe you want to automise  e.g. run 32-bit python for a 32 program (if you are using conda you can just type ``set CONDA_FORCE_32BIT=1`` to get this done)

## Statistical rethinking 
[Statistical rethinking](https://xcelab.net/rm/statistical-rethinking/) is a book by Richard McElreath. It mainly covers Bayesian inference using R which is a statistical software/language. It has a pretty hands on approach. So it comes with a library with lots of data and tools you can use to master Bayesian inference. The idea is pretty much to combine data with a model to arrive at something which is better than both. 

The book has a bit too many words for me. It is really afraid of showing the reader formulas so I guess that is good for some peeps. R is pretty easy to use although I find it a bit confusing at times.  Internal functions are very flexible in the sense that they accept inputs which would certainly raise an error in other programs. For example, for certain statistical functions for which mathematically the same length vectors are needed R will accept vectors of different length and just repeat the last element of the shorter vector to match the length of the longer vector D: 

For statistical stuff R is way more convenient than anything else I know. Here is a beautiful normal distribution with just a short line of code ``curve( dnorm( x , 420 , 42 ) , from=320 , to=520 )`` :D

<center>
![image.png](https://cdn.steemitimages.com/DQmTd7Vo5YS4XDG2mFFqmWWCnGdoUmGn5Tjx7wkMTpVGzXd/image.png)
</center>

Time for some modelling exercises from statistical rethinking :o)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 495 others
👎  , , ,
properties (23)
authormathowl
permlinkcorona-data-analysis-automising-exe-with-python-and-statistical-rethinking
categoryhive-196387
json_metadata{"tags":["blog","corona","mathematics","steemstem","palnet","neoxian","stem"],"image":["https://cdn.steemitimages.com/DQmVcoUWz38S8HRstfqDcKft6zKDL4mGJV2nvx9TsWWdS4L/corona_spread.jpg","https://cdn.steemitimages.com/DQmbndDnqqQBaL6N63rFkbBW2nAx1NoNbqNC7sBT9MbUrZt/corona_spread_extinction.jpg","https://cdn.steemitimages.com/DQmTd7Vo5YS4XDG2mFFqmWWCnGdoUmGn5Tjx7wkMTpVGzXd/image.png"],"links":["https://steemit.com/steemstem/@mathowl/data-analysis-on-corona-spread-in-china-1-22-2-08","https://github.com/pywinauto/pywinauto","https://github.com/pywinauto/pywinauto/issues/800","https://xcelab.net/rm/statistical-rethinking/"],"app":"steemit/0.2","format":"markdown"}
created2020-02-21 11:23:12
last_update2020-02-27 05:18:48
depth0
children18
last_payout2020-02-28 11:23:12
cashout_time1969-12-31 23:59:59
total_payout_value5.331 HBD
curator_payout_value5.281 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,390
author_reputation44,993,635,814,620
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,674,037
net_rshares36,989,678,781,663
author_curate_reward""
vote details (563)
@agmoore2 ·
$0.02
lzkfkej2m
>never fully trust when somebody cannot provide a quantative reason backed by real data. Also note that people who think that long term extrapolation is useful without understanding the underlying dynamics are stupid. 

:))

Even if I don't get the math (and I don't) there's always a gem in your post.  Stay well @mathowl.  Nobody knows where this thing is going, so speculating is one way to entertain ourselves. 
👍  , ,
properties (23)
authoragmoore2
permlinklzkfkej2m
categoryhive-196387
json_metadata{"tags":"steemstem","app":"steemstem"}
created2020-02-23 18:44:18
last_update2020-02-23 18:44:18
depth1
children0
last_payout2020-03-01 18:44:18
cashout_time1969-12-31 23:59:59
total_payout_value0.012 HBD
curator_payout_value0.011 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length415
author_reputation19,407,067,157,250
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,751,110
net_rshares151,369,479,712
author_curate_reward""
vote details (3)
@culgin ·
@tipu curate
properties (22)
authorculgin
permlinkre-mathowl-q61vdg
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"steempeak/2020.02.2"}
created2020-02-21 11:46:30
last_update2020-02-21 11:46:30
depth1
children2
last_payout2020-02-28 11:46:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length12
author_reputation170,100,255,531,223
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,674,524
net_rshares0
@mathowl ·
Thankies

Posted using [Partiko Android](https://partiko.app/referral/mathowl)
👍  ,
properties (23)
authormathowl
permlinkmathowl-re-culgin-re-mathowl-q61vdg-20200222t032749866z
categoryhive-196387
json_metadata{"app":"partiko","client":"android"}
created2020-02-22 03:27:51
last_update2020-02-22 03:27:51
depth2
children0
last_payout2020-02-29 03:27:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length78
author_reputation44,993,635,814,620
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,700,529
net_rshares28,014,595,835
author_curate_reward""
vote details (2)
@tipu ·
<a href="https://tipu.online/curator?culgin" target="_blank">Upvoted &#128076;</a> (Mana: 10/15 - <a href="https://steempeak.com/steem/@tipu/tipu-curate-project-update-recharging-curation-mana" target="_blank">need recharge</a>?)
properties (22)
authortipu
permlinkre-re-mathowl-q61vdg-20200221t114649
categoryhive-196387
json_metadata""
created2020-02-21 11:46:48
last_update2020-02-21 11:46:48
depth2
children0
last_payout2020-02-28 11:46:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length229
author_reputation55,902,105,514,997
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,674,533
net_rshares0
@enforcer48 ·
Only 25 years?

Not bad. Lol
👍  
properties (23)
authorenforcer48
permlinkre-mathowl-q68osh
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"steempeak/2020.02.3"}
created2020-02-25 04:07:30
last_update2020-02-25 04:07:30
depth1
children0
last_payout2020-03-03 04:07:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length28
author_reputation426,233,073,731,239
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,799,953
net_rshares5,577,020,075
author_curate_reward""
vote details (1)
@marcos-708 ·
### According to the Bible, *Ask Bro. Eliseo Soriano: Is Jesus God? or Man?*
### Watch the Video below to know the Answer...
***(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)***
https://youtu.be/aMA6F1t8dVU
Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to **Thank you, our beloved friend.**  
Check our [Discord Chat](https://discord.gg/vzHFNd6) 
Join our Official Community: https://steemit.com/created/hive-182074
👍  
👎  
properties (23)
authormarcos-708
permlink7r6xgorqmdc
categoryhive-196387
json_metadata""
created2020-02-21 11:31:27
last_update2020-02-21 11:31:27
depth1
children0
last_payout2020-02-28 11:31:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length590
author_reputation-7,490,395,056,362
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout10,000.000 HBD
percent_hbd100
post_id95,674,209
net_rshares-20,524,785,951
author_curate_reward""
vote details (2)
@mark123 ·
### According to the Bible, *Bro. Eli: How many heavens are there according to the Bible?*
### Watch the Video below to know the Answer...
***(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)***
https://youtu.be/y3Bor0p1J0I
Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to **Thank you, our beloved friend.**  
Check our [Discord Chat](https://discord.gg/vzHFNd6) 
Join our Official Community: https://steemit.com/created/hive-182074
👍  
properties (23)
authormark123
permlinkxlaj2tgvulq
categoryhive-196387
json_metadata""
created2020-02-27 05:27:03
last_update2020-02-27 05:27:03
depth1
children0
last_payout2020-03-05 05:27:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length604
author_reputation-4,924,698,259,161
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout10,000.000 HBD
percent_hbd100
post_id95,869,918
net_rshares0
author_curate_reward""
vote details (1)
@new-questions ·
Using bots with third-party accounts   @steemflagrewards
properties (22)
authornew-questions
permlinkq68nh4
categoryhive-196387
json_metadata{"users":["steemflagrewards"],"app":"steemit/0.2"}
created2020-02-25 03:39:03
last_update2020-02-25 03:39:03
depth1
children3
last_payout2020-03-03 03:39:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length56
author_reputation18,342,039,048
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,799,507
net_rshares0
@mathowl ·
lol
👍  ,
properties (23)
authormathowl
permlinkq68sc6
categoryhive-196387
json_metadata{"app":"steemit/0.2"}
created2020-02-25 05:24:09
last_update2020-02-25 05:24:09
depth2
children0
last_payout2020-03-03 05:24:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3
author_reputation44,993,635,814,620
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,801,330
net_rshares26,694,721,889
author_curate_reward""
vote details (2)
@meesterboom ·
Lol. You are a total dick
properties (22)
authormeesterboom
permlinkq68z6i
categoryhive-196387
json_metadata{"app":"steemit/0.2"}
created2020-02-25 07:51:54
last_update2020-02-25 07:51:54
depth2
children0
last_payout2020-03-03 07:51:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length25
author_reputation1,787,763,378,201,875
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,805,910
net_rshares0
@steemflagrewards ·
Please do some research before making claims. 
properties (22)
authorsteemflagrewards
permlinkre-new-questions-q68ony
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"steempeak/2020.02.3"}
created2020-02-25 04:04:45
last_update2020-02-25 04:04:45
depth2
children0
last_payout2020-03-03 04:04:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length46
author_reputation90,302,625,572,111
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,799,911
net_rshares0
@steemstem ·
re-mathowl-corona-data-analysis-automising-exe-with-python-and-statistical-rethinking-20200221t140124134z
<div class='text-justify'> <div class='pull-left'> <center> <br /> <img width='200' src='https://res.cloudinary.com/drrz8xekm/image/upload/v1553698283/weenlqbrqvvczjy6dayw.jpg'> </center>  <br/> </div> 

This post has been voted on by the **SteemSTEM curation team** and voting trail. It is elligible for support from @curie and @minnowbooster.<br /> 

If you appreciate the work we are doing, then consider supporting our witness [@stem.witness](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=stem.witness). Additional witness support to the [curie witness](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=curie) would be appreciated as well.<br /> 

For additional information please join us on the [SteemSTEM discord]( https://discord.gg/BPARaqn) and to get to know the rest of the community!<br />

Please consider using the <a href='https://www.steemstem.io'>steemstem.io</a> app and/or including @steemstem in the list of beneficiaries of this post. This could yield a stronger support from SteemSTEM.
properties (22)
authorsteemstem
permlinkre-mathowl-corona-data-analysis-automising-exe-with-python-and-statistical-rethinking-20200221t140124134z
categoryhive-196387
json_metadata{"app":"steemstem-bot"}
created2020-02-21 14:01:27
last_update2020-02-21 14:01:27
depth1
children0
last_payout2020-02-28 14:01:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,050
author_reputation262,017,435,115,313
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,677,850
net_rshares0
@sweetpea ·
Hell @steemstem - I was wondering if you could help me? It seems you have blacklisted me and I now have a nasty red (1) next to my username. I am not sure why since it's been quite some time (months) since I last used your tag? 

I was previously asked to included sources to qualify for an upvote - which I did in all posts that followed. 

This is the first time I have EVER received a mark against my name on Steemtit, so I am sure you can understand my upset?

Kindly advise and hopefully rectify it?

Thank, you :) @astrophoto.kevin
properties (22)
authorsweetpea
permlinkq63py7
categoryhive-196387
json_metadata{"users":["steemstem","astrophoto.kevin"],"app":"steemit/0.2"}
created2020-02-22 11:44:33
last_update2020-02-22 11:44:33
depth1
children5
last_payout2020-02-29 11:44:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length537
author_reputation51,509,818,731,532
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,709,371
net_rshares0
@astrophoto.kevin ·
Hey @sweetpea,
as @mathowl already wrote, please visit the steemstem discord for those questions.
Anyway, I have already submitted your request.
properties (22)
authorastrophoto.kevin
permlinkq649x5
categoryhive-196387
json_metadata{"users":["sweetpea","mathowl"],"app":"steemit/0.2"}
created2020-02-22 18:50:57
last_update2020-02-22 18:50:57
depth2
children1
last_payout2020-02-29 18:50:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length144
author_reputation86,277,108,443,159
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,720,343
net_rshares0
@sweetpea ·
Thank you @astrophoto.kevin I appreciate it. I did visit steemstem on Discord, as advised by @steemcleaners, but I wasn't given the functionality to type in my request, I could only read the discussions.
properties (22)
authorsweetpea
permlinkq64y4w
categoryhive-196387
json_metadata{"users":["astrophoto.kevin","steemcleaners"],"app":"steemit/0.2"}
created2020-02-23 03:39:00
last_update2020-02-23 03:39:00
depth3
children0
last_payout2020-03-01 03:39:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length203
author_reputation51,509,818,731,532
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,730,735
net_rshares0
@mathowl ·
I am not sure why you tagged astro but pls head over to the steemstem discord for these type of questions -> discord.gg/mKSKQ7T
👍  
properties (23)
authormathowl
permlinkq63rkx
categoryhive-196387
json_metadata{"app":"steemit/0.2"}
created2020-02-22 12:19:45
last_update2020-02-22 12:19:45
depth2
children2
last_payout2020-02-29 12:19:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length127
author_reputation44,993,635,814,620
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,710,348
net_rshares14,772,322,844
author_curate_reward""
vote details (1)
@astrophoto.kevin ·
I think she's tagging me as I have commented here soap post a while ago.
https://steemit.com/steemstem/@sweetpea/05-learn-how-to-make-your-own-natural-soap-how-to-colour-soap-using-natural-ingredients
properties (22)
authorastrophoto.kevin
permlinkq64987
categoryhive-196387
json_metadata{"links":["https://steemit.com/steemstem/@sweetpea/05-learn-how-to-make-your-own-natural-soap-how-to-colour-soap-using-natural-ingredients"],"app":"steemit/0.2"}
created2020-02-22 18:35:57
last_update2020-02-22 18:35:57
depth3
children0
last_payout2020-02-29 18:35:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length200
author_reputation86,277,108,443,159
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,720,063
net_rshares0
@sweetpea ·
Hello @mathowl - I have been to steemstem on Discord as previously advised by steamcleaners, but it did not give me the functionality to participate in a discussion - I could only read the threads. The invite you have given me above works and I will leave a message there - thank you.
properties (22)
authorsweetpea
permlinkq652gp
categoryhive-196387
json_metadata{"users":["mathowl"],"app":"steemit/0.2"}
created2020-02-23 05:12:27
last_update2020-02-23 05:12:27
depth3
children0
last_payout2020-03-01 05:12:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length284
author_reputation51,509,818,731,532
root_title"Corona data analysis, automising .exe with python and statistical rethinking"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,732,483
net_rshares0