cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
jmper
Level I

CDF function in JSL

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
ms
Super User (Alumni) ms
Super User (Alumni)

Re: CDF function in JSL

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 );

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: CDF function in JSL

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 );

jmper
Level I

Re: CDF function in JSL

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!