Fits a function that returns value based on daily temperature
Usage
fit_gaussian(rmax, topt, a)
Arguments
- rmax
maxmimum rate at optimum temperature
- topt
optimum reproductive temperature
- a
width parameter
Value
function that accepts x and returns y based on fitted model
Details
Fits a Gaussian curve to produce a temperature scalar ranging from 0 to rmax:
$$
r_{max} \cdot e(-0.5 \cdot (\frac{|x - t_{opt}|}{a}))^2)
$$
Examples
my_func <- EndoSim:::fit_gaussian(1, 25, 3)
plot(seq(0, 50, by = 0.1), my_func(seq(0, 50, by = 0.1)), type = "l")