Title: | Distribution of Gaussian Ratios |
---|---|
Description: | It is well known that the distribution of a Gaussian ratio does not follow a Gaussian distribution. The lack of awareness among users of vegetation indices about this non-Gaussian nature could lead to incorrect statistical modeling and interpretation. This package provides tools to accurately handle and analyse such ratios: density function, parameter estimation, simulation. An example on the study of chlorophyll fluorescence can be found in A. El Ghaziri et al. (2023) <doi:10.3390/rs15020528>. |
Authors: | Pierre Santagostini [aut, cre], Angélina El Ghaziri [aut], Nizar Bouhlel [aut], David Rousseau [ctb] |
Maintainer: | Pierre Santagostini <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.1 |
Built: | 2025-02-11 19:22:21 UTC |
Source: | CRAN |
Density of the ratio of two Gaussian distributions.
dnormratio(z, bet, rho, delta)
dnormratio(z, bet, rho, delta)
z |
length |
bet , rho , delta
|
numeric values. The parameters |
Let two independant random variables
and
.
If we denote ,
and
,
the probability distribution function of the ratio
is given by:
with
and
Numeric: the value of density.
Pierre Santagostini, Angélina El Ghaziri, Nizar Bouhlel
El Ghaziri, A., Bouhlel, N., Sapoukhina, N., Rousseau, D., On the importance of non-Gaussianity in chlorophyll fluorescence imaging. Remote Sensing 15(2), 528 (2023). doi:10.3390/rs15020528
Díaz-Francés, E., Rubio, F.J., On the existence of a normal approximation to the distribution of the ratio of two independent normal random variables. Stat Papers 54, 309–323 (2013). doi:10.1007/s00362-012-0429-2
rnormratio()
: sample simulation.
estparnormratio()
: parameter estimation.
# First example beta1 <- 0.15 rho1 <- 5.75 delta1 <- 0.22 dnormratio(0, bet = beta1, rho = rho1, delta = delta1) dnormratio(0.5, bet = beta1, rho = rho1, delta = delta1) curve(dnormratio(x, bet = beta1, rho = rho1, delta = delta1), from = -0.1, to = 0.7) # Second example beta2 <- 2 rho2 <- 2 delta2 <- 2 dnormratio(0, bet = beta2, rho = rho2, delta = delta2) dnormratio(0.5, bet = beta2, rho = rho2, delta = delta2) curve(dnormratio(x, bet = beta2, rho = rho2, delta = delta2), from = -0.1, to = 0.7)
# First example beta1 <- 0.15 rho1 <- 5.75 delta1 <- 0.22 dnormratio(0, bet = beta1, rho = rho1, delta = delta1) dnormratio(0.5, bet = beta1, rho = rho1, delta = delta1) curve(dnormratio(x, bet = beta1, rho = rho1, delta = delta1), from = -0.1, to = 0.7) # Second example beta2 <- 2 rho2 <- 2 delta2 <- 2 dnormratio(0, bet = beta2, rho = rho2, delta = delta2) dnormratio(0.5, bet = beta2, rho = rho2, delta = delta2) curve(dnormratio(x, bet = beta2, rho = rho2, delta = delta2), from = -0.1, to = 0.7)
Estimation of the parameters of
a ratio ,
and
being two independant random variables distributed
according to Gaussian distributions,
using the EM (estimation-maximization) algorithm.
estparnormratio(z, eps = 1e-6)
estparnormratio(z, eps = 1e-6)
z |
numeric matrix or data frame. |
eps |
numeric. Precision for the estimation of the parameters. |
Let a random variable: ,
and
being normally distributed:
and
.
The density probability of is:
with: ,
,
.
and is the confluent hypergeometric function
(Kummer's function):
The parameters ,
,
of the
distribution
are estimated with the EM algorithm, as presented in El Ghaziri et al.
The computation uses the
kummerM
function.
This uses an iterative algorithm.
The precision for the estimation of the parameters is given by the eps
parameter.
A list of 3 elements beta
, rho
, delta
:
the estimated parameters of the distribution
,
,
,
with two attributes
attr(, "epsilon")
(precision of the result) and attr(, "k")
(number of iterations).
Pierre Santagostini, Angélina El Ghaziri, Nizar Bouhlel
El Ghaziri, A., Bouhlel, N., Sapoukhina, N., Rousseau, D., On the importance of non-Gaussianity in chlorophyll fluorescence imaging. Remote Sensing 15(2), 528 (2023). doi:10.3390/rs15020528
dnormratio()
: probability density of a normal ratio.
rnormratio()
: sample simulation.
# First example beta1 <- 0.15 rho1 <- 5.75 delta1 <- 0.22 set.seed(1234) z1 <- rnormratio(800, bet = beta1, rho = rho1, delta = delta1) estparnormratio(z1) # Second example beta2 <- 0.24 rho2 <- 4.21 delta2 <- 0.25 set.seed(1234) z2 <- rnormratio(800, bet = beta2, rho = rho2, delta = delta2) estparnormratio(z2)
# First example beta1 <- 0.15 rho1 <- 5.75 delta1 <- 0.22 set.seed(1234) z1 <- rnormratio(800, bet = beta1, rho = rho1, delta = delta1) estparnormratio(z1) # Second example beta2 <- 0.24 rho2 <- 4.21 delta2 <- 0.25 set.seed(1234) z2 <- rnormratio(800, bet = beta2, rho = rho2, delta = delta2) estparnormratio(z2)
-Hypergeometric FunctionComputes the Kummer's function, or confluent hypergeometric function.
kummerM(a, b, z, eps = 1e-06)
kummerM(a, b, z, eps = 1e-06)
a |
numeric. |
b |
numeric |
z |
numeric vector. |
eps |
numeric. Precision for the sum (default 1e-06). |
The Kummer's confluent hypergeometric function is given by:
where is the Pochhammer symbol (see
pochhammer
).
The eps
argument gives the required precision for its computation.
It is the attr(, "epsilon")
attribute of the returned value.
A numeric value: the value of the Kummer's function,
with two attributes attr(, "epsilon")
(precision of the result) and attr(, "k")
(number of iterations).
Pierre Santagostini, Angélina El Ghaziri, Nizar Bouhlel
El Ghaziri, A., Bouhlel, N., Sapoukhina, N., Rousseau, D., On the importance of non-Gaussianity in chlorophyll fluorescence imaging. Remote Sensing 15(2), 528 (2023). doi:10.3390/rs15020528
Computes the logarithm of the Pochhammer symbol.
lnpochhammer(x, n)
lnpochhammer(x, n)
x |
numeric. |
n |
positive integer. |
The Pochhammer symbol is given by:
So, if :
If ,
Numeric value. The logarithm of the Pochhammer symbol.
Pierre Santagostini, Nizar Bouhlel
lnpochhammer(2, 0) lnpochhammer(2, 1) lnpochhammer(2, 3)
lnpochhammer(2, 0) lnpochhammer(2, 1) lnpochhammer(2, 3)
Computes the Pochhammer symbol.
pochhammer(x, n)
pochhammer(x, n)
x |
numeric. |
n |
positive integer. |
The Pochhammer symbol is given by:
Numeric value. The value of the Pochhammer symbol.
Pierre Santagostini, Nizar Bouhlel
pochhammer(2, 0) pochhammer(2, 1) pochhammer(2, 3)
pochhammer(2, 0) pochhammer(2, 1) pochhammer(2, 3)
Simulate data from a ratio of two Gaussian distributions.
rnormratio(n, bet, rho, delta)
rnormratio(n, bet, rho, delta)
n |
integer. Number of observations. If |
bet , rho , delta
|
numeric values. The parameters |
Let two random variables
and
with probability densities and
.
The parameters of the distribution of the ratio are:
,
,
.
,
,
and
are computed from
,
and
(by fixing arbitrarily
)
and two random samples
and
are simulated.
Then is returned.
A numeric vector: the produced sample.
Pierre Santagostini, Angélina El Ghaziri, Nizar Bouhlel
El Ghaziri, A., Bouhlel, N., Sapoukhina, N., Rousseau, D., On the importance of non-Gaussianity in chlorophyll fluorescence imaging. Remote Sensing 15(2), 528 (2023). doi:10.3390/rs15020528
dnormratio()
: probability density of a normal ratio.
estparnormratio()
: parameter estimation.
# First example beta1 <- 0.15 rho1 <- 5.75 delta1 <- 0.22 rnormratio(20, bet = beta1, rho = rho1, delta = delta1) # Second example beta2 <- 0.24 rho2 <- 4.21 delta2 <- 0.25 rnormratio(20, bet = beta2, rho = rho2, delta = delta2)
# First example beta1 <- 0.15 rho1 <- 5.75 delta1 <- 0.22 rnormratio(20, bet = beta1, rho = rho1, delta = delta1) # Second example beta2 <- 0.24 rho2 <- 4.21 delta2 <- 0.25 rnormratio(20, bet = beta2, rho = rho2, delta = delta2)