Understanding the statistical function "expinv"

Hi everyone,
I am pretty new to the community and I might need your help to understand the behaviour of a new octave function vs his original behaviour in matlab.

I was on my trial licence using the built-in expinv function from matlab and everything was working fine. I used it the following way:

p = 99 %percentile I aim for
mu = ema(data,20) %My mean of the distribution
expinv(p, mu)

I then had to change my licence and drop the Statistics Toolbox. I hence downloaded the expinv function from Octave (Function Reference: expinv) and I got different values and results and I don’t understand why.

The dataset I use is mainly (but not strictly) between [0;1]. While digging through the code of the octave expinv, I realised that it does not accept values <0 or >1 which is probably related to the exponential cumulative distribution function.

However, I am just looking for a way to fit an exponential distribution to my data and get back, for any value in my data, the value of the Xth percentile and I don’t understand why I would not be able to do that on a distribution with values higher than 1. I am also not sure this new expinv is now doing what I want or if I should find another to do it.

Thanks for the help!

Did you cherry-pick a specific function from the Octave statistics package for use within Matlab? There’s no guarantee of mutual consistency if you do that.

The expinv function inverts the CDF, which by definition is in the [0 1] range, so any inputs for expinv outside the [0 1] domain will stay at the default value of NaN. You should normalize it before calling expinv.