Tag Archives: Python

Fooled by probability – Monty Hall Problem

“You made a mistake, but look at the positive side. If all those Ph.D.’s were wrong, the country would be in some very serious trouble.” Everett Harman, Ph.D. U.S. Army Research Institute Probability is a terrible branch of science, I … Continue reading

Posted in Data Analytics | Tagged , , , , , | 3 Comments

A great tutorial on the FFT using Python, Numpy,Scipy & Matplotlib

Great FFT tutorial from Real Python

Posted in Data Analytics | Tagged , , , | Leave a comment

Fast Fourier Transform – An Intuition

One of my favorite youtube channels, 3Blue1Brown, has a great video on the intuition of the FFT. Check the video above. Below Python code to implement that intuition:

Posted in Data Analytics | Tagged , , , | Leave a comment

Python Pandas – descriptive stats from a frequency table

Suppose you are a teacher, and want to keep track of and do some simple descriptive stats on your student’s scores in a number of subjects. So you have recorded scores in a frequency table as below: Left-most column has … Continue reading

Posted in Data Analytics | Tagged , , | Leave a comment

Covid-19 Sweden: A summary

Sweden has been painted as the Black Sheep of the international community with respect to its ways to deal with the Covid-19 virus.  People and orginizations around the world were very quick to paint Sweden as the Sodom & Gomorra … Continue reading

Posted in Bayes, Data Analytics, Epidemics, MCMC, Pandas, Politik, Probability, PYMC, Python, Society, Statistics, Sverige | Tagged , , , , , , , , , , , | 4 Comments

Corona Sweden : Infection Fatality Rate

It’s been a while ago since I ran my MCMC-hack to estimate the Swedish Infection Fatality Rate, main reason being that each run takes an awful lot of computing time, around 10h, to get the MCMC to converge… and during … Continue reading

Posted in Bayes, Data Analytics, Epidemics, MCMC, Pandas, Probability, PYMC, Python, Statistics | Tagged , , , , , , , , , | Leave a comment

Corona Sweden – Herd Immunity matters

Sweden, and particularily the Swedish chief epidemiologist Anders Tegnell, as well as his predecessor/mentor Johan Giesecke, have received huge amounts of critizism for the “Swedish Strategy” fighting Corona. A key component of Tegnell’s & Giesecke’s rationale for not recommending Lockdown … Continue reading

Posted in Epidemics, Probability, Python, Simulation | Tagged , , , | Leave a comment

MCMC “Internals” – fitting the data

Lately, I’ve been puzzling over how exactly MCMC fits the data of the likelihood, that is, how exactly is that fitting done by the various tools implementing MCMC. So, this post is maily about MCMC Internals, not about how to … Continue reading

Posted in Bayes, Math, MCMC, Probability, Simulation | Tagged , , , , , | Leave a comment

Fooled by Averages and Ignorant of Uncertainty – Bayesian Inference to assistance

As a follow up to my previous posts [1,2,3] on the danger’s of relying upon averages, and Simpson’s paradox, which is a consequence of misused averaging, here’s yet another angle on the same topic. Let’s first resume with the baseball … Continue reading

Posted in Bayes, Data Analytics, Gambling, Pandas, Probability, PYMC, Python, Statistics | Tagged , , , , , , | 3 Comments

The Metropolis-Hastings MCMC algorithm, implemented in Python

I’ve been using MCMC for quite a few years now, but always as a “Black Box”, that is, I’ve used tools such as PYMC or Stan, that implement different MCMC algorithms.  Until now, I’ve never opened up the Black Box, … Continue reading

Posted in Probability, Python | Tagged , , | Leave a comment