Violinplotter version 2 is out
Violinplotter version 2 is out with the option to:
plot sample size of 1 as a point,
append sample sizes, and
include or exclude specific error bars.
Plus a quick fix (parsing explanatory variables) is on-track to be released as version 2.0.1.
Fitting logistic growth rate with optim()
Given a logistic growth function of the form:
where y_max is the maximum level reached (e.g. maximum biomass or maximum number of individuals in a population), k is the maximal growth rate, t0 is the time at which the growth rate is at maximum, and t is the time. We can fit our growth data as a logistic function of time using the cost function:
We can use R's optimisation function `optim()` while being mindful of the minimum and maximum possible parameter values, i.e. try not too use infinities in the lower and upper bounds of the parameter search space.
To illustrate, given the following growth data across 13 days on 2 treatments:
We fit these data on a logistic function by finding the optimum parameter values:
Inspired by Randall Munroe's post, I made a recursive R function which calculates the arithmetic mean, median, harmonic mean, and geometric mean until they converge. The geometric mean is dropped if the product of the input is negative. :-P
The Bulmer effect is the reduction in the additive genetic variance of a highly polygenic trait after every generation under directional selection. This effect is entirely due to the correlation between pairs of loci as a result of linkage (physical proximity) or random associations.
Why combustion releases energy?
From Schmidt-Rohr (2015):
"The double bond in O2 is much weaker than other double bonds or pairs of single bonds, and therefore the formation of the stronger bonds in CO2 and H2O results in the release of energy, which is given off as heat or increases thermal motion. This explains why fire is hot regardless of fuel composition. The bond energies in the fuel play only a minor role; for example, the total bond energy of CH4 is nearly the same as that of CO2."
I have been used to thinking that breaking the strong bonds in fuel releases energy; however it's the formation of the stronger bonds in the combustion products, i.e. CO2 and H2O that releases energy. Energy is required to break the strong bonds between CO2, it follows that generating the same bonds in CO2 releases energy.
In simple terms, Fst measures the ratio between the observed heterozygosity (Ho) and the expected heterozygosity (He).
The expected heterozygosity can be computed following the Hardy-Weinberg equilibrium principle, e.g. for a biallelic locus this is 2p(1-p) where p is the frequency of one of the alleles.
On one extreme, if the ratio between observed and expected heterozygosities in a population is zero, i.e. Ho/He = 0, then this means that the individuals or subpopulations are not intercrossing (i.e. assortative mating and/or selfing and/or asexually reproducing). Hence the population is said to be highly structured. In terms of Fst:
Fst = 1 - (Ho/He).
Therefore, if Ho/He = 0 then Fst = 1, which means highly structure populations.
On the other extreme, a population with Ho/He = 1 or Fst = 0, means that the individuals or subpopulations are intercrossing freely as if they were a single panmictic population, hence the population is said to have no structure.
Be careful with the precision of numbers in R
In reality, 10,000,000 / 3 = 3,333,333.333...
However, computing this in R will round this to 3,333,333. No decimal places.
Likewise, instead of showing that 10,000,001 / 5 = 2,000,000.20, R rounds the answer to the integer 2,000,000.
In Python, this rounding off is suppressed by implying that either or both the divisor and dividend are floating point numbers, e.g. 10000001.0/5
In Julia, the quotient is expressed in scientific notation, and so this is avoided.
However, it is important to note here that limits in precision exist regardless of the language used. But my point here is that, the limit in R is 1x10^7.