Re: [Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-30 Thread Stéphane Mottelet
See my post on Discourse: https://scilab.discourse.group/t/exponentially-modified-gaussian-distribution S. On 4/30/24 08:46, Stéphane Mottelet wrote: Hello, As I already said, there is no need for using this technique, as an EMG random variable is the sum of a Gaussian and an exponential. If

Re: [Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-30 Thread Stéphane Mottelet
Hello, As I already said, there is no need for using this technique, as an EMG random variable is the sum of a Gaussian and an exponential. If your CDF reads as f = (a/2)*exp((a/2)*((a*σ^2)-2*h)) .* erfc((a*σ^2-h)/σ/sqrt(2)) then the underlying variable is the sum of Gaussian of mean 0,

Re: [Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-29 Thread Heinz Nabielek
Very useful. I had done a similar thing with the EMG, but much more clumsy Heinz > On 29.04.2024, at 16:41, Federico Miyara wrote: > > > Heinz, > > I don't know if this might be useful. The function I'm attaching allows to > generate random numbers according to any distribution, either

Re: [Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-29 Thread Heinz Nabielek
On 29.04.2024, at 09:24, Stéphane Mottelet wrote: > > Sorry, > > This is just a manifestation of another occurence of the xy problem. You > told about y (drawing from a given PDF) but the original problem was x : > drawing a random variable which is the sum of two random variables for > which we

Re: [Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-29 Thread Stéphane Mottelet
Sorry, This is just a manifestation of another occurence of the xy problem. You told about y (drawing from a given PDF) but the original problem was x : drawing a random variable which is the sum of two random variables for which we already have generators. In fact an EMG random variable Z may

Re: [Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-29 Thread Stéphane Mottelet
Hello, I think that the best method available for this application (you wil need a massive number of draws) is the rejection method (https://en.wikipedia.org/wiki/Rejection_sampling). Let us continue this discussion on Scilab's Discourse... S. On 4/29/24 05:11, Heinz Nabielek wrote:

[Scilab-users] I need a numerial procedure to generate Exponentially Modified Gaussian deviates

2024-04-28 Thread Heinz Nabielek
Colleagues: bird flight altitude probabilities are given by the exponentially modified Gaussian distribution EMG f=f(h), in my case f = (a/2)*exp((a/2)*((a*σ^2)-2*h)) .* erfc((a*σ^2-h)/σ/sqrt(2)) with h=hmeasured-85 in meters, a=1/60m, σ=30m. See: