Creating an n x n autocorrelation matrix

Walking around in old Lisbon.

Between covid-19 news and announcements of imminent Russia-Ukraine wars I needed a bit of a distraction. Sooo, here it is how to create an n x n autocorrelation matrix based on a correlation rho, with a simple 5 x 5 example in R:

This produces the following output: A 5 x 5 autocorrelation matrix… Continue reading Creating an n x n autocorrelation matrix

The beauty of code vectorisation

Garden wind sculpture

I came across this problem in Twitter: Description of the problem by Fermat's Library. The basic pieces of the problem are: We need to generate pseudorandom numbers with an identical distribution, add them up until they go over 1 and report back how many numbers we needed to achieve that condition.Well, do the above "quite… Continue reading The beauty of code vectorisation

From character to numeric pedigrees

Breakdancing in Ancud, Chiloé.

In quantitative genetic analyses we often use a pedigree to represent the relatedness between individuals, so this is accounted in the analyses, because the observations are not independent of each other. Often this pedigree contains alphanumeric labels, and most software can cope with that. Sometimes, though, we want to use numeric identities because we would… Continue reading From character to numeric pedigrees

Published
Categorized as r, teaching

Being data curious: the strange case of lamb consumption in NZ

Sheep meat consumption, kg/person. Data from OECD statistics.

There is a lot of talk about the skills needed for working in Statistics/Data Science, with the discussion often focusing on theoretical understanding, programming languages, exploratory data analysis, and visualization. There are many good blog posts dealing with how you get data, process it with your favorite language and then creating some good-looking plots. However,… Continue reading Being data curious: the strange case of lamb consumption in NZ