turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- CDF function in JSL

Topic Options

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

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

Apr 7, 2014 10:12 PM
(3100 views)

Is there a cdf function in JSL that can return the percentile of a value x with a distribution defined by an array or a column in data table?

I only found functions that return the percentiles for special distribution functions (normal, beta, gamma...), but I need t find out in an array of measured data what is the percentile of one measured value.

1 ACCEPTED SOLUTION

Accepted Solutions

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

Apr 8, 2014 3:32 AM
(5253 views)

There is a function CDF() that generates a list with two matrices that can be used for finding the approximate percentiles. The distribution platform can also be used (interactively or via JSL).

The results will differ between the three methods below, especially for extreme percentiles and small number of data:

dt = Open**(** "$SAMPLE_DATA/Big Class.jmp" **)**;

Y = :Weight << **get values**;

**{**Quant, CumProb**}** = CDF**(** Y **)**;

P = **[****0.1**, **0.5**, **0.9****]**; // Example of percentile levels

// Find approximate values of the P percentiles by "matching"

P1 = Quant**[**Loc Sorted**(** CumProb, P **)]**;

// Find approximate P percentiles by interpolating the CDF

// For small data sets the results depends much on the choice of smoothing term lambda (here 1)

P2 = Spline Eval**(** P, Spline Coef**(** CumProb, Quant, **1** **)** **)**;

// Find approximate percentiles using Distribution platform

dist = dt << **Distribution****(**

Continuous Distribution**(**

Column**(** :weight **)**,

Fit Distribution**(** Smooth Curve**(** Quantiles**(** P**[****1****]**, P**[****3****]**, P**[****2****]** **)** **)** **)**

**)**

**)**;

P3 =Report**(** dist **)[**Number Col Box**(**"Quantile"**)]**<<**get ****as matrix**;

Show**(** P1, P2, P3 **)**;

2 REPLIES

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

Apr 8, 2014 3:32 AM
(5254 views)

There is a function CDF() that generates a list with two matrices that can be used for finding the approximate percentiles. The distribution platform can also be used (interactively or via JSL).

The results will differ between the three methods below, especially for extreme percentiles and small number of data:

dt = Open**(** "$SAMPLE_DATA/Big Class.jmp" **)**;

Y = :Weight << **get values**;

**{**Quant, CumProb**}** = CDF**(** Y **)**;

P = **[****0.1**, **0.5**, **0.9****]**; // Example of percentile levels

// Find approximate values of the P percentiles by "matching"

P1 = Quant**[**Loc Sorted**(** CumProb, P **)]**;

// Find approximate P percentiles by interpolating the CDF

// For small data sets the results depends much on the choice of smoothing term lambda (here 1)

P2 = Spline Eval**(** P, Spline Coef**(** CumProb, Quant, **1** **)** **)**;

// Find approximate percentiles using Distribution platform

dist = dt << **Distribution****(**

Continuous Distribution**(**

Column**(** :weight **)**,

Fit Distribution**(** Smooth Curve**(** Quantiles**(** P**[****1****]**, P**[****3****]**, P**[****2****]** **)** **)** **)**

**)**

**)**;

P3 =Report**(** dist **)[**Number Col Box**(**"Quantile"**)]**<<**get ****as matrix**;

Show**(** P1, P2, P3 **)**;

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

Apr 8, 2014 9:30 AM
(2973 views)

My question was how to get CumProb from Quant and your examples are how to get Quant from CumProb, but the sample principle applies. Thanks a lot!