Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Distributions and Curves Intersection

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 23, 2020 8:38 AM
(1750 views)

Dear Community I have a need to be solved (I do not found similar question in blog).

I have 2 set of data.

I created the 2 distributions.

I "aks to JMP" to found the better curve fit for each single distribution.

Now I need to found the intersetion point (X= ...) between the 2 curves.

In attachement you can find the example of dataset and the visualization of what I need.

Thanks in advance for your feedback.

Best Regards.

Simone

2 ACCEPTED SOLUTIONS

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here is a crude script that will get you the values. Not sure it will work for all comparisons...but it might. Try it out. The results display in the log.

```
Names Default To Here( 1 );
dt = Current Data Table();
// Change these values to the actual values of the 2 distributions
m1 = 203.315;
s1 = 203.33 - m1;
max1 = 203.37;
m2 = 203.345;
s2 = 203.355 - m2;
max2 = 203.4;
If( Normal Density( min(m1,m2), mu = m1, sigma = s1 ) > Normal Density( min(m1,m2), mu = m2, sigma = s2 ),
mh = m1;
sh = s1;
ml = m2;
sl = s2;
,
mh = m2;
sh = s2;
ml = m1;
sl = s1;
);
For( i = ml, i <= Min( max1, max2 ), i = i + ((Min( max1, max2 ) - ml) / 1000000),
r = i;
nd1 = Normal Density( r, mu = mh, sigma = sh );
nd2 = Normal Density( r, mu = ml, sigma = sl );
lastnd1 = nd1;
lastnd2 = nd2;
lasti = i;
If( nd2 > nd1,
x = Mean( i, lasti ); y = Mean( nd1, nd2, lastnd1, lastnd2 );
show(x,y) ;
Break();
);
);
```

Jim

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Apr 28, 2020 2:55 AM
| Last Modified: Apr 28, 2020 2:56 AM
(1641 views)
| Posted in reply to message from Simone1 04-27-2020

Once you have the formula columns saved (in this case for two Gaussians), you can get a long way by using the crosshair tool.

But if you want an 'exact' answer, you could define an auxiliary formula column and use 'Maximize Desirability' in the Profiler (see the attached table). But note that you still need to inspect the plots, and use the Response Limits column property to restrict the range of the optimization appropriately. In this example, I also used this property with the two original columns (with a weight of zero) just to allow all three columns to be profiled at the same time.

*Before:*

*After:*

6 REPLIES 6

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Distributions and Curves Intersection

I believe that there is no direct way. That is to say, there is no platform with this capability. You could use the Minimize() function with the difference between the two probability density functions using their respective estimated distribution parameters in a script. The independent variable is the quantile.

Please provide data and examples in JMP files, not Excel files in the future.

Learn it once, use it forever!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Distributions and Curves Intersection

Dear Mark,

thank you for the feedback.

I "hoped" there was some capability to do this in JMP...

Regarding you suggestion... I will try to follow it (even if I'm not an expert in the JMP Script).

Have you a good day.

Best Regards,

Simone

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Apr 28, 2020 2:55 AM
| Last Modified: Apr 28, 2020 2:56 AM
(1642 views)
| Posted in reply to message from Simone1 04-27-2020

Once you have the formula columns saved (in this case for two Gaussians), you can get a long way by using the crosshair tool.

But if you want an 'exact' answer, you could define an auxiliary formula column and use 'Maximize Desirability' in the Profiler (see the attached table). But note that you still need to inspect the plots, and use the Response Limits column property to restrict the range of the optimization appropriately. In this example, I also used this property with the two original columns (with a weight of zero) just to allow all three columns to be profiled at the same time.

*Before:*

*After:*

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Distributions and Curves Intersection

Thanks Ian.

Appreciated your good feedback.

Best Regards,

Simone

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here is a crude script that will get you the values. Not sure it will work for all comparisons...but it might. Try it out. The results display in the log.

```
Names Default To Here( 1 );
dt = Current Data Table();
// Change these values to the actual values of the 2 distributions
m1 = 203.315;
s1 = 203.33 - m1;
max1 = 203.37;
m2 = 203.345;
s2 = 203.355 - m2;
max2 = 203.4;
If( Normal Density( min(m1,m2), mu = m1, sigma = s1 ) > Normal Density( min(m1,m2), mu = m2, sigma = s2 ),
mh = m1;
sh = s1;
ml = m2;
sl = s2;
,
mh = m2;
sh = s2;
ml = m1;
sl = s1;
);
For( i = ml, i <= Min( max1, max2 ), i = i + ((Min( max1, max2 ) - ml) / 1000000),
r = i;
nd1 = Normal Density( r, mu = mh, sigma = sh );
nd2 = Normal Density( r, mu = ml, sigma = sl );
lastnd1 = nd1;
lastnd2 = nd2;
lasti = i;
If( nd2 > nd1,
x = Mean( i, lasti ); y = Mean( nd1, nd2, lastnd1, lastnd2 );
show(x,y) ;
Break();
);
);
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Distributions and Curves Intersection

Hello Jim,

thanks for the feedback.

I will apply it!

Best Regards,

Simone

Article Labels

There are no labels assigned to this post.