cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
CerealGuy
Level I

Prediction Profilier Simulation automation

Hello All!

 

Within the Prediction Profiler the user is able to generate PPM values with given prediction formulas, inputs, and spec limits. This can be done by simply hitting the "simulate" button next to the prediction profiler in the profiler GUI setup. At this point, a table will be generated containing the mean, PPM, and Standard Deviation values.

 

I am curious: Can this process be automated within a script (or elsewhere in the GUI) to produce multiple PPM values over a set range of values for any of the input variables. I would use this data to then plot and show the various PPM values vs the given input parameters. As of now, I have not found a way to do this. The only way currently is to simply alter the input value and hit the simulate button again, then manually documenting the output PPM value. This is obviously not a very efficient way to do it, but through my searches online and in these forums I have not found another method.

 

I would greatly appreciate any tips to help automate this process! Thanks.

3 REPLIES 3
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Prediction Profilier Simulation automation

Hi @CerealGuy, welcome to the community!

 

The simulator in JMP has a tool called simulation experiment which was built for what I believe you are trying to accomplish here.  The script below has comments which you should be able to follow, along with some exploration of the simulation menus to find the right commands (look in the red triangle next to Simulation inside the profiler).  Is this the path you are looking for?

 

Names default to here(1);

// Open a sample data set and make a prediction for yield
dt = Open("$Sample_data/Ro.jmp");

fm = Fit Model(
	Y( :Yield ),
	Effects( :Aperture, :Ranging, :Cadence ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Effect Leverage" ),
	Run(
		:Yield << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
		Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
		Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
		Box Cox Y Transformation( 0 )}
	)
);

fm << Prediction Formula;

// Use simulation in the profiler to estimate variation in yield at a single point
prf = Profiler(
	Y( :Pred Formula Yield ),
	Profiler(
		1,
		Term Value(
			Aperture( 11.25, Lock( 0 ), Show( 1 ) ),
			Ranging( 10, Lock( 0 ), Show( 1 ) ),
			Cadence( 22.5, Lock( 0 ), Show( 1 ) )
		),
		Simulator(
			1,
			Factors(
				Aperture << Random( Normal( 11.25, 2 ) ),
				Ranging << Random( Normal( 10, 1 ) ),
				Cadence << Random( Normal( 22.5, 4 ) )
			),
			Responses( Pred Formula Yield << No Noise )
		)
	)
);

// Do a simulation experiment to calculation variation in yield for 
// different levels of your inputs.  Note that you might need to
// adjust the ranges for different variables before this step using
// 'resent factor grid' to ensure you explore the relevant space.
dtSim = prf << Simulator( Simulation Experiment( 512, 1 ) );
dtSim << New Column( "Lowest Yield Expected",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula( :Pred Formula Yield Mean - 3 * :Pred Formula Yield SD )
);

// Graph results
dtSim << Graph Builder(
	Size( 558, 552 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Aperture ),
		Y( :Ranging ),
		Wrap( :Cadence, Levels( 9 ) ),
		Color( :Lowest Yield Expected )
	),
	Elements( Contour( X, Y, Legend( 9 ) ) )
);

ih_0-1628634711441.png

 

CerealGuy
Level I

Re: Prediction Profilier Simulation automation

Thank you @ih , this answer is just what I was looking for! I appreciate the comments and thorough code for each of the sections I had described.

 

My only additional question is how I can set the "Spec Limits" from the simulator in this script as well. Such as this:

// Use simulation in the profiler to estimate variation in yield at a single point
prf = Profiler(
	Y( :Pred Formula Yield ),
	Profiler(
		1,
		Term Value(
			Aperture( 11.25, Lock( 0 ), Show( 1 ) ),
			Ranging( 10, Lock( 0 ), Show( 1 ) ),
			Cadence( 22.5, Lock( 0 ), Show( 1 ) )
		),
		Simulator(
			1,
			Factors(
				Aperture << Random( Normal( 11.25, 2 ) ),
				Ranging << Random( Normal( 10, 1 ) ),
				Cadence << Random( Normal( 22.5, 4 ) )
			),
			Responses( Pred Formula Yield << No Noise ),
            Spec Limits( Pred Formula Yield, LSL(0), USL(2) )     // insert actual Spec Limits Code here		)
	)
);

If I add this code equivalent, the Spec Limits dialog box pops up, but I have been unable to get it populated with various expressions in the "Spec Limits()" call. I have been having trouble finding any documentation for small things like this.

ian_jmp
Staff

Re: Prediction Profilier Simulation automation

Try 'Help > Scripting Index' and search for 'Simulator':

Screenshot 2021-08-13 at 12.41.32.png

These examples should help.