estparnormratio: Estimation of the Parameters of a Normal Ratio Distribution

View source: R/estparnormratio.R

estparnormratioR Documentation

Estimation of the Parameters of a Normal Ratio Distribution

Description

Estimation of the parameters of a ratio \displaystyle{Z = \frac{X}{Y}}, X and Y being two independent random variables distributed according to Gaussian distributions, using the EM (estimation-maximization) algorithm or variational inference. Depending on the estimation method, the estparnormatio function calls estparEM (EM algorithm) or estparVB (variational Bayes).

Usage

estparnormratio(z, method = c("EM", "VB"), eps = 1e-06,
                       display = FALSE, mux0 = 1, sigmax0 = 1,
                       alphax0 = NULL, betax0 = NULL, muy0 = 1, sigmay0 = 1,
                       alphay0 = NULL, betay0 = NULL)

estparEM(z, eps = 1e-06,  display = FALSE, #plot = display,
                       mux0 = 1, sigmax0 = 1, muy0 = 1, sigmay0 = 1)

estparVB(z, eps = 1e-06, display = FALSE, mux0 = 1, sigmax0 = 1,
                       alphax0 = 1, betax0 = 1, muy0 = 1, sigmay0 = 1,
                       alphay0 = 1, betay0 = 1)

estparEM(
  z,
  eps = 1e-06,
  display = FALSE,
  mux0 = 1,
  sigmax0 = 1,
  muy0 = 1,
  sigmay0 = 1
)

estparVB(
  z,
  eps = 1e-06,
  display = FALSE,
  mux0 = 1,
  sigmax0 = 1,
  alphax0 = 1,
  betax0 = 1,
  muy0 = 1,
  sigmay0 = 1,
  alphay0 = 1,
  betay0 = 1
)

Arguments

z

numeric.

method

the method used to estimate the parameters of the distribution. It can be "EM" (expectation-maximization) or "VB" (Variational Bayes).

eps

numeric. Precision for the estimation of the parameters (see Details).

display

logical. When TRUE the successive values of the stop criterion (distance between successive values) is printed.

mux0, sigmax0, muy0, sigmay0

initial values of the means and standard deviations of the X and Y variables. Default: mux0 = 1, sigmax0 = 1, muy0 = 1, sigmay0 = 1.

alphax0, betax0, alphay0, betay0

initial values for the variational Bayes method. Omitted if method="EM". If method="VB", if omitted, they are set to 1.

Details

Let a random variable: \displaystyle{Z = \frac{X}{Y}},

X and Y being normally distributed: X \sim N(\mu_x, \sigma_x) and Y \sim N(\mu_y, \sigma_y).

The density probability of Z is:

\displaystyle{ f_Z(z; \beta, \rho, \delta_y) = \frac{\rho}{\pi (1 + \rho^2 z^2)} \ \exp{\left(-\frac{\rho^2 \beta^2 + 1}{2\delta_y^2}\right)} \ {}_1 F_1\left( 1, \frac{1}{2}; \frac{1}{2 \delta_y^2} \frac{(1 + \beta \rho^2 z)^2}{1 + \rho^2 z^2} \right) }

with: \displaystyle{\beta = \frac{\mu_x}{\mu_y}}, \displaystyle{\rho = \frac{\sigma_y}{\sigma_x}}, \displaystyle{\delta_y = \frac{\sigma_y}{\mu_y}}.

and _1 F_1\left(a, b; x\right) is the confluent hypergeometric function (Kummer's function):

\displaystyle{ _1 F_1\left(a, b; x\right) = \sum_{n = 0}^{+\infty}{ \frac{ (a)_n }{ (b)_n } \frac{x^n}{n!} } }

If method = "EM", the means and standard deviations \mu_x, \sigma_x, \mu_y and \sigma_y are estimated with the EM algorithm, as presented in El Ghaziri et al. If method = "VB", they are estimated with the variational Bayes method as presented in Bouhlel et al.

Then the parameters \beta, \rho, \delta_y of the Z distribution are computed from these means and standard deviations.

The estimation of \mu_x, \sigma_x, \mu_y and \sigma_y uses an iterative algorithm. The precision for their estimation is given by the eps parameter.

The computation uses the kummer function.

If there are ties in the z vector, it generates a warning, as there should be no ties in data distributed among a continuous distribution.

Value

A list of 3 elements beta, rho, delta: the estimated parameters of the Z distribution \hat{\beta}, \hat{\rho}, \hat{\delta}_y, with three attributes attr(, "epsilon") (precision of the result), attr(, "k") (number of iterations) and attr(, "method") (estimation method).

Author(s)

Pierre Santagostini, Angélina El Ghaziri, Nizar Bouhlel

References

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). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/rs15020528")}

Bouhlel, N., Mercier, F., El Ghaziri, A., Rousseau, D., Parameter Estimation of the Normal Ratio Distribution with Variational Inference. 2023 31st European Signal Processing Conference (EUSIPCO), Helsinki, Finland, 2023, pp. 1823-1827. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.23919/EUSIPCO58844.2023.10290111")}

See Also

dnormratio(): probability density of a normal ratio.

rnormratio(): sample simulation.

Examples


# First example
beta1 <- 0.15
rho1 <- 5.75
delta1 <- 0.22

set.seed(1234)
z1 <- rnormratio(800, bet = beta1, rho = rho1, delta = delta1)

# With the EM method:
estparnormratio(z1, method = "EM")

# With the variational method:
estparnormratio(z1, method = "VB")

# Second example
beta2 <- 0.24
rho2 <- 4.21
delta2 <- 0.25

set.seed(1234)
z2 <- rnormratio(800, bet = beta2, rho = rho2, delta = delta2)

# With the EM method:
estparnormratio(z2, method = "EM")

# With the variational method:
estparnormratio(z2, method = "VB")



gaussratiovegind documentation built on June 16, 2025, 5:09 p.m.