In my "day job" I'm a PhD student, and I use the R statistical programming language quite a bit. This means that I also tend to look for opportunities to use it elsewhere, like here in home brewing (which I've just gotten back into). What's nice is that R is free open source software, so anyone (not too intimidated by heavy maths and stats) can download it and use it at home.
Anyway, I have my first extract brew (and first home brew in about 10 years) sitting in primary. I've been taking SG measurements more or less daily, but, in typical first brewer fashion, I've been getting impatient.
So what I decided to do was to fit a model of yeast growth to my measurements, and try to predict when primary fermentation would be done. What I did was to estimate the ABV at the measurement times from OG and SG, and use that as my "y value". I figured ABV should be a reasonable measure of yeast growth.
I then found a free package for R that does growth curve modelling, and plugged the values in. groFit supports a few different growth model equations; for this data the Gompertz and logistic models worked.
Now, since I only have four readings so far, I had to add in a dummy point to help prevent over-fit (and because groFit won't even run with fewer than five). When I made the recipe, I did it in Beer Calculus, which estimated a final gravity of 1.014. (I'd be curious to know how they work this out). From that, I could estimate the final ABV to be about 4.891. So, I created a dummy point at an extreme timepoint (500 hours after pitching), with the estimated final ABV.
And here are the results, with the estimated final ABV plotted as a dotted line, and the fitted logistic and Gompertz curves. From this, I can estimate that attenuation will happen sometime between 300-400 hours (12-16 days) after pitching. There are a ton of assumptions in this, but it was a fun exercise.
Here is the source code and data for those interested. I'll probably keep updating as fermentation progresses and I take more measurements.
What do people think of using SG as a proxy for yeast growth? Comments on the methodology?
Anyway, I have my first extract brew (and first home brew in about 10 years) sitting in primary. I've been taking SG measurements more or less daily, but, in typical first brewer fashion, I've been getting impatient.
So what I decided to do was to fit a model of yeast growth to my measurements, and try to predict when primary fermentation would be done. What I did was to estimate the ABV at the measurement times from OG and SG, and use that as my "y value". I figured ABV should be a reasonable measure of yeast growth.
I then found a free package for R that does growth curve modelling, and plugged the values in. groFit supports a few different growth model equations; for this data the Gompertz and logistic models worked.
Now, since I only have four readings so far, I had to add in a dummy point to help prevent over-fit (and because groFit won't even run with fewer than five). When I made the recipe, I did it in Beer Calculus, which estimated a final gravity of 1.014. (I'd be curious to know how they work this out). From that, I could estimate the final ABV to be about 4.891. So, I created a dummy point at an extreme timepoint (500 hours after pitching), with the estimated final ABV.
And here are the results, with the estimated final ABV plotted as a dotted line, and the fitted logistic and Gompertz curves. From this, I can estimate that attenuation will happen sometime between 300-400 hours (12-16 days) after pitching. There are a ton of assumptions in this, but it was a fun exercise.
Here is the source code and data for those interested. I'll probably keep updating as fermentation progresses and I take more measurements.
What do people think of using SG as a proxy for yeast growth? Comments on the methodology?