Amir Khalilian

Rayleigh-Rice Mixture Model Estimation

  1. Problem in hand
  2. Rayleigh-Rice mixture
  3. Sample Result
  4. Matlab implementation

Problem in hand

Consider the data with all positive values denoted as sns_n for all n{1, ,N}n\in\{1,\cdots,N\}. It is desired to find an unsupervised threshold τs\tau_s such that we say for sn>τss_n>\tau_s the data point nn belongs to a class otherwise the data point belongs to the other class. In order to find such a threshold without introducing any extra parameters we use a Rayleigh-Rice mixture model. Note that the values of sns_n are positive and Rayleigh-Rice mixture models these values very well. Once the Rayleigh-Rice mixture model is fitted, the intersection of the two distributions is the threshold value.

Rayleigh-Rice mixture

Let α\alpha indicate the probability that a sample ss is from a Rayleigh distribution with parameter b2b^2 and 1α1-\alpha the probability that ss is from the Rice distribution with parameters ν\nu and σ2\sigma^2. Then, the distribution of the mixture model can be written as

f(sΨ)=αfRayl(sb2)+(1α)fRice(sν,σ2) f(s|\Psi) = \alpha f_{Rayl}(s|b^2) + (1-\alpha) f_{Rice} (s|\nu,\sigma^2)

where Ψ={α,b2,ν,σ2}\Psi = \{\alpha, b^2, \nu, \sigma^2\} and

fRayl(sb2)=sb2exp(s22b2),s0 f_{Rayl}(s|b^2) = \frac{s}{b^2} \exp\left(-\frac{s^2}{2b^2}\right), \quad s\geq0

and

fRice(sν,σ2)=sσ2exp(s2+ν22σ2)I0(sνσ2),s0 f_{Rice} (s|\nu,\sigma^2) = \frac{s}{\sigma^2} \exp\left(-\frac{s^2+\nu^2}{2\sigma^2}\right) I_0\left(\frac{s\nu}{\sigma^2}\right), \quad s\geq0

with I0()I_0(\cdot) is the 0-th order modified Bessel function of first kind. Given the samples {sn}n=1N\{s_n\}_{n=1}^N we want to find the parameters of this model (Ψ={α,b2,ν,σ2}\Psi = \{\alpha, b^2, \nu, \sigma^2\}). Expectation-Maximization (EM) algorithm can be used to estimate the model parameters Ψ\Psi. Following algorithm shows the steps of the EM for fitting the Rayleigh-Rice model.

Given the fitted model parameters the threshold value is found by solving the following for τs\tau_s.

α1α=fRayl(τsb2)fRice(τsν,σ2). \frac{\alpha}{1-\alpha} = \frac{f_{Rayl}(\tau_s|b^2)}{f_{Rice} (\tau_s|\nu,\sigma^2)}.

Sample Result

A sample histogram of sns_n for all n{1, ,N}n\in\{1,\cdots,N\} is shown in figure. The plotted curves show the fitted Rayleigh and Rice distributions. In this example, the values of sns_n denote the standard deviation of electrode activity and the fitted model separates the active and inactive electrodes.

Matlab implementation

The matlab implementation is provided here.