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
be expressed as Z = X + Y, where X and Y are independent, X is Gaussian
with mean μ and variance σ2, and Y is exponential of rate λ
(https://en.wikipedia.org/wiki/Exponentially_modified_Gaussian_distribution).

So you just have to use grand
(https://help.scilab.org/docs/2024.0.0/en_US/grand.html) to make
independant draws of X and Y then make the sum afterwards

S.


On 4/29/24 08:53, Stéphane Mottelet wrote:
Hello,

I think that the best method available for this application (you wil
need a massive number of draws) is the rejection method
(https://antiphishing.vadesecure.com/v4?f=UERGdHg5cm1GRGl1YjhpeIZFujPY8-l5ZKAsVrZPIXrBA1YUJSBwS6v_Z_tlJsgh&i=cFpWc2dOMHdjcFZGMTl4Ng1_zKOb4VfyPb7ITkhLE8Q&k=hNdW&r=bHdDQW5tZDVCemI1ZVczSRLgxDOkCpIXuvcVP3kQ4ZNl3wZFY-aM6EkdaTlJ-T4B&s=a235fcad73b939a4a3e646b9493cfb924ed27ef41d118d10aa17ce462170e545&u=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FRejection_sampling).
Let us continue this
discussion on Scilab's Discourse...

S.

On 4/29/24 05:11, Heinz Nabielek wrote:
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:
<https://antiphishing.vadesecure.com/v4?f=TzBPM05TMWhaUkVuRncwepXXm7aQUUs8a3sBKnOeo3zqzzPE1PUeJxFSe39wh75Y&i=NmhwUWdPbjljNWRxSlVxNUTscW_rXmsdS5CfW3ms-T8&k=Yhxs&r=bGlzcjBDTTd4VWcyWjZtQ6_TAL2evagZ2vYr-1xJf13LwHIc8EKwrvfWFnwxUdMu&s=54fcca2dabb8b02e9b10abb7c1f2938e90f160a2cb53c8e34c8bf8d215ab3a96&u=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FExponentially_modified_Gaussian_distribution>.

For bird flight Monte-Carlo simulations, I need random deviates
representing this distribution.
Normally, I generate the cumulative function F of f. Then, I project
uniform random numbers U(0,1) on F^-1, the inverse of the cumulative.

With the EMG, closed solutions are not available and I need a
numerial procedure to generate EMG deviates.
What is the best way to do this?
Best greetings
Heinz
This email and any attachments are intended solely for the use of the
individual or entity to whom it is addressed and may be confidential
and/or privileged.

If you are not one of the named recipients or have received this
email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete
this email and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to
our data privacy policy as described on our website. Should you have
any questions related to personal data protection, please contact 3DS
Data Protection Officer
https://antiphishing.vadesecure.com/v4?f=TzBPM05TMWhaUkVuRncwepXXm7aQUUs8a3sBKnOeo3zqzzPE1PUeJxFSe39wh75Y&i=NmhwUWdPbjljNWRxSlVxNUTscW_rXmsdS5CfW3ms-T8&k=Yhxs&r=bGlzcjBDTTd4VWcyWjZtQ6_TAL2evagZ2vYr-1xJf13LwHIc8EKwrvfWFnwxUdMu&s=32fd60a5220ff414f060b063dbad3fd497b0262a1a66989e7b8e20f9d7c7a9bb&u=https%3A%2F%2Fwww.3ds.com%2Fprivacy-policy%2Fcontact%2F





_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://antiphishing.vadesecure.com/v4?f=TzBPM05TMWhaUkVuRncwepXXm7aQUUs8a3sBKnOeo3zqzzPE1PUeJxFSe39wh75Y&i=NmhwUWdPbjljNWRxSlVxNUTscW_rXmsdS5CfW3ms-T8&k=Yhxs&r=bGlzcjBDTTd4VWcyWjZtQ6_TAL2evagZ2vYr-1xJf13LwHIc8EKwrvfWFnwxUdMu&s=fad40986af4782d963cce3e934e1b3a27f33aac0d0c0cf2fc74c3083c7682e2a&u=https%3A%2F%2Flists.scilab.org%2Fmailman%2Flistinfo%2Fusers


--
Stéphane Mottelet
Ingénieur de recherche HDR
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
https://antiphishing.vadesecure.com/v4?f=UERGdHg5cm1GRGl1YjhpeIZFujPY8-l5ZKAsVrZPIXrBA1YUJSBwS6v_Z_tlJsgh&i=cFpWc2dOMHdjcFZGMTl4Ng1_zKOb4VfyPb7ITkhLE8Q&k=hNdW&r=bHdDQW5tZDVCemI1ZVczSRLgxDOkCpIXuvcVP3kQ4ZNl3wZFY-aM6EkdaTlJ-T4B&s=400c609e5d747f0602b75960a3c07a8b840bb89166c364330d50e830fac92ca5&u=http%3A%2F%2Fwww.utc.fr%2F~mottelet


_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://antiphishing.vadesecure.com/v4?f=UERGdHg5cm1GRGl1YjhpeIZFujPY8-l5ZKAsVrZPIXrBA1YUJSBwS6v_Z_tlJsgh&i=cFpWc2dOMHdjcFZGMTl4Ng1_zKOb4VfyPb7ITkhLE8Q&k=hNdW&r=bHdDQW5tZDVCemI1ZVczSRLgxDOkCpIXuvcVP3kQ4ZNl3wZFY-aM6EkdaTlJ-T4B&s=e023c8bb3350a391f5f48c31acd13e7908386745368c118b54a6a9370af2d70f&u=https%3A%2F%2Flists.scilab.org%2Fmailman%2Flistinfo%2Fusers

This email and any attachments are intended solely for the use of the
individual or entity to whom it is addressed and may be confidential
and/or privileged.

If you are not one of the named recipients or have received this email
in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete
this email and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to
our data privacy policy as described on our website. Should you have
any questions related to personal data protection, please contact 3DS
Data Protection Officer
https://antiphishing.vadesecure.com/v4?f=UERGdHg5cm1GRGl1YjhpeIZFujPY8-l5ZKAsVrZPIXrBA1YUJSBwS6v_Z_tlJsgh&i=cFpWc2dOMHdjcFZGMTl4Ng1_zKOb4VfyPb7ITkhLE8Q&k=hNdW&r=bHdDQW5tZDVCemI1ZVczSRLgxDOkCpIXuvcVP3kQ4ZNl3wZFY-aM6EkdaTlJ-T4B&s=4962f485eb9d241779dc996385c2507870387f5ff098d4c711918833faf281ee&u=https%3A%2F%2Fwww.3ds.com%2Fprivacy-policy%2Fcontact%2F

--
Stéphane Mottelet
Ingénieur de recherche HDR
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

Reply via email to