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

in StemSocial5 years ago (edited)

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 I had a look at the underlying function driving the corona spread. I got an excellent fit to a quadratic function:


corona_spread.jpg

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)


corona_spread_extinction.jpg

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 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 . 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 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


image.png

Time for some modelling exercises from statistical rethinking :o)

Sort:  

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.

Only 25 years?

Not bad. Lol



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

If you appreciate the work we are doing, then consider supporting our witness @stem.witness. Additional witness support to the curie witness would be appreciated as well.

For additional information please join us on the SteemSTEM discord and to get to know the rest of the community!

Please consider using the steemstem.io app and/or including @steemstem in the list of beneficiaries of this post. This could yield a stronger support from SteemSTEM.

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

 5 years ago  

I am not sure why you tagged astro but pls head over to the steemstem discord for these type of questions -> discord.gg/mKSKQ7T

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.



Anyway, I have already submitted your request.Hey @sweetpea, as @mathowl already wrote, please visit the steemstem discord for those questions.

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.

Using bots with third-party accounts @steemflagrewards

Please do some research before making claims.

Lol. You are a total dick

 5 years ago  Reveal Comment
 5 years ago  Reveal Comment