Merci Régis,

Your example helped me to solve my problem. To explain you solution without 
showing your code I just summarize it.
Threshold_1 and Threshold_2 as I defined in my question have to be used weights 
in the Mixture distribution.
Essentially:

Weight_1 = LeftDistribution.computeCDF( Intersection )
LeftPart = TruncatedDistribution(LeftDistribution, Intersection , 
TruncatedDistribution.UPPER)
 
Weight_2 = 1 – Weight_1
RightPart = TruncatedDistribution(RightDistribution, Intersection , 
TruncatedDistribution.LOWER)

MixedDistribution = Mixture([LeftPart, RightPart], [Weight_1, Weight_2])

But I could not get the Brent() solver to work for me. I stayed with 
scipy.optimize in order to find the intersection. I will look further into 
Brent() to understand how to apply it correctly.

Thanks again,
Henning

-----Original Message-----
From: regis lebrun [mailto:[email protected]] 
Sent: 21. marts 2016 16:29
To: Henning Brüske
Subject: Re: [ot-users] TruncatedDistribution, Mixture distribution

Hi,

The parameter thresholdRealization found in the constructor of a 
TruncatedDistribution is used to select between rejection and CDF inversion for 
the random generator associated to the truncated distribution, so no link with 
what you want. No bug here.

From what you describe, I understand that you need to build a mixture of 2 
distributions (left and right) such that:
+ the mixture has a continuous PDF
+ the part of the PDF at the left of a truncation point to be found is 
+ exactly the PDF of the left distribution

Here you have to find the truncation point t and the weight w of the left 
distribution. The weight is given by the first constraint, the truncation point 
by the second constraint. All the details are in the attached script.

Best regards,

Régis





>________________________________
> De : Henning Brüske <[email protected]> À : "[email protected]" 
><[email protected]> Envoyé le : Lundi 21 mars 2016 14h40 Objet : 
>[ot-users] TruncatedDistribution, Mixture distribution
> 
>
>
> 
>Dear openTURNS users,
> 
>I want to create a distribution that consists out of two truncated 
>distributions. Similar to the example in the picture.
>The first or left part of the combined distribution shall follow exactly the 
>original distribution (called “Proof loading” in the example). The second or 
>right part would be adjusted so that the CDF reaches 1 again.
> 
>I thought I could do this with a combination of Truncated and Mixture 
>distribution.
>I created two distribution truncated at “l”, the boundary in the example 
>picture. From the documentation 
>http://doc.openturns.org/openturns-latest/sphinx/user_manual/_generated/openturns.TruncatedDistribution.html
> I assumed the parameter “threshold“ would allow to set an limit to the total 
>probability of the truncated distributions.
>E.g. the code I tried is like:
> 
>Threshold_1 = ProofLoading.ComputeCDF( l ) LeftPart = 
>TruncatedDistribution(ProofLoading, l , TruncatedDistribution.UPPER, 
>threshold = Treshold_1)
> 
>Threshold_2 = 1 – Threshold_1
>RightPart = TruncatedDistribution(Resistance, l , 
>TruncatedDistribution.LOWER, threshold = Treshold_2)
> 
>R_proof = Mixture([LeftPart, RightPart])
> 
>But I don’t see an effect of ‘threshold’ at all.
> 
>If my approach is wrong, how can I achieve it? Or is this maybe a bug? I’m 
>using OT 1.7 with python 3.5 from Anaconda.
> 
>Thank you very much!
> 
> 
>Best regards,
> 
>Henning
> 
>_______________________________________________
>OpenTURNS users mailing list
>[email protected]
>http://openturns.org/mailman/listinfo/users
>
>
>
_______________________________________________
OpenTURNS users mailing list
[email protected]
http://openturns.org/mailman/listinfo/users

Reply via email to