cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
nikles
Level VI

Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

Hi.  I'm wondering if anyone knows a way to specify which distributions are used when performing Best Fit in the Process Capability platform?  For example, suppose a user wants to analyze a data set that they know is non-normal.  They would like to JMP to analyze using the distribution that fits the best, but they know they want it to only pick from Johnson or Gamma.  The script form of this would ideally look like:

 

dt = Open("$SAMPLE_DATA/Process Measurements.jmp");
dt <<Process Capability(
	Process Variables(:Process 1 & Dist(Johnson, Gamma)),
	Moving Range Method(Average of Moving Ranges),
	Capability Box Plots(1),
	Individual Detail Reports(0),
	Capability Index Plot(1)
)

Where in the Process Variables(), I put "...& Dist(Johnson, Gamma)" instead of "Dist(BestFit)".  Of course, my code above does not work and the result shows Johnson only, but this hopefully gives you an idea of the kind of thing I'd like.

 

I'm running JMP Pro 17.2.0.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandTSI
Level V

Re: Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

Manually adding Gamma to this Capability and saving the script gave me the required syntax.

 

dt = Open("$SAMPLE_DATA/Process Measurements.jmp");
dt <<Process Capability(
	Process Variables( :Process 1 & Dist( Johnson ), :Process 1 & Dist( Gamma ) ),
	Moving Range Method(Average of Moving Ranges),
	Capability Box Plots(1),
	Individual Detail Reports(0),
	Capability Index Plot(1)
)

View solution in original post

5 REPLIES 5
mmarchandTSI
Level V

Re: Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

Manually adding Gamma to this Capability and saving the script gave me the required syntax.

 

dt = Open("$SAMPLE_DATA/Process Measurements.jmp");
dt <<Process Capability(
	Process Variables( :Process 1 & Dist( Johnson ), :Process 1 & Dist( Gamma ) ),
	Moving Range Method(Average of Moving Ranges),
	Capability Box Plots(1),
	Individual Detail Reports(0),
	Capability Index Plot(1)
)
txnelson
Super User

Re: Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

If you want to let JMP determine which distribution is the best fit, and then only run the Process Capability on the "best fit" distribution, the below script first runs a Distribution Platform and finds the best fit, and then runs the Process Capability on the best fit distribution.

Names default to here(1);
dt =
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// Run 
dis = Distribution(invisible,
	Continuous Distribution(
		Column( :PNP3 ),
		Fit Normal( Show Fit( 0 ) ),
		Fit Cauchy( Show Fit( 0 ) ),
		Fit Student's t( Show Fit( 0 ) ),
		Fit Lognormal,
		Fit Exponential( Show Fit( 0 ) ),
		Fit Gamma( Show Fit( 0 ) ),
		Fit Johnson( Show Fit( 0 ) ),
		Fit SHASH( Show Fit( 0 ) ),
		Fit Normal 2 Mixture( Show Fit( 0 ) ),
		Fit Normal 3 Mixture( Show Fit( 0 ) ),
		Fit Weibull( Show Fit( 0 ) ),
		Process Capability( Use Column Property Specs )
	)
);
fitList = report(dis)["Compare Distributions", stringcolbox(1)]<<get;
If(contains(fitList,"Gamma") < contains(fitList,"Johnson Sb"), best = "Gamma", best = "Johnson");

report(dis) << close window;

eval(substitute(expr(
dt << Process Capability(
	Process Variables( :PNP3 & Dist( _best_ ) ), 
	Moving Range Method( Average of Moving Ranges ),
	Capability Index Plot( 1 )
);),
expr( _best_ ), parse(best))
);

Jim
nikles
Level VI

Re: Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

Thanks Jim.  

Great idea, but unfortunately that might not be an option for me.  My data sets are ~10k x 10k and each extra fit I run on each column just really increases the runtime.  Thus I'd hoped to just limit the search for a best fit to a few distributions and exclude the others.   

jthi
Super User

Re: Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

You can easily limit which distributions to fit when using Distribution platform

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Process Measurements.jmp");

dist = dt << Distribution(
	Continuous Distribution(
		Column(:Process 1),
		Fit Gamma,
		Fit Johnson,
		Process Capability(0)
	),
	Invisible /*can use private in JMP17 I think*/
);

dists = Report(dist)[OutlineBox("Compare Distributions"), Table Box(1), String Col Box(1)] << get;
dist_to_use = dists[1];
wait(0);
dist << Close Window;

dist_expr = Parse("Dist("||Word(1, dist_to_use)||")");

Eval(EvalExpr(
	pc = dt << Process Capability(
		Process Variables(:Process 1 & Expr(Name Expr(dist_expr))),
		Moving Range Method(Average of Moving Ranges),
		Capability Box Plots(1),
		Individual Detail Reports(0),
		Capability Index Plot(1)
	)
));
-Jarmo
nikles
Level VI

Re: Process Capability Platform: Is there a way to specify the distributions used for Best Fit?

Thanks @mmarchandTSI .  I wasn't aware I could put the same column in the "Process Variables()" multiple times.  This could be the answer.  I still need to somehow evaluate which distribution is the best fit, but I believe I can capture the AICc from each dist and use that to determine the best one.   Will be interesting to see if this is faster than just running a "best fit" using all the distributions.