Description Usage Arguments Details Value
View source: R/chillingUnits.R
Compute chilling units accumulated by a plant, according to a beta-shaped function.
1 2 3 4 5 6 7 8 | chillingUnits(
temp.data,
var.names = list(temp = "temp", date = "date", duration = "duration"),
temp.min = -5,
temp.max = 15,
mu,
s
)
|
temp.data |
a data frame with the dates and temperatures to accumulate |
var.names |
the name of the temperature and date variables, in the format |
temp.min |
the threshold above which the plant is accumulating chilling units |
temp.max |
the threshold below which the plant is accumulating chilling units |
mu |
the temperature at which the plant accumulates the highest number of chilling units |
s |
the sample size of the underlying Beta distribution |
The accumulation of chilling units is expressed as the Beta law probability distribution function (pdf). The underlying Beta law is re-parametrized
using the mode and the so-called sample size. More precisely, using the following definition for the pdf of the Beta law with parameters a
and b
:
\frac{Γ(a+b)}{Γ (a)+Γ (b)} \ x^{a-1}(1-x)^{1-b}
for 0 ≤q x ≤q 1, a>0 and b >0. Now, we further assume here that a > 1 and b > 1, so that the mode exists, and we parametrized the Beta distribution using μ and s defined as:
μ = \frac{a-1}{a+b-2}, \quad s = a+b
Since the Beta law has its support on [0,1], it is evaluated at (x-temp.min)/(temp.max-temp.min)
, where x
is the recorded temperature, and
mu
is transformed into (mu-temp.min)/(temp.max-temp.min)
to lie between 0 and 1
a vector with the chilling units corresponding to each input temperature
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.