cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar

Trying to JSL script and get the maximum desirability from RSM design

Hello! 

 

New user of JMP. I'm using the student trial version, and I want to use the JSL script to use RSM design. Here's how far I got...

Names Default To Here( 1 );

// Here are the factors and the ranges
factors = {
	{"X1", 0, 1, "Continuous"},
	{"X2", 0, 1, "Continuous"},
	{"X3", 0, 1, "Continuous"}
};

rsm = DOE( Response Surface Design );

// Add a response
rsm << AddResponse( Minimize, "Y");

// Add the factors. We will need to overwrite the defaults
// overwrite the two built‑ins
For( i = 1, i <= Min( N Items( factors ), 2 ), i++,
	rsm << Change Factor Settings( i, factors[i][2], factors[i][3], factors[i][1] );
);

// add any remaining
For( i = 3, i <= N Items( factors ), i++,
	rsm << Add Factor( Continuous, factors[i][2], factors[i][3], factors[i][1], 0 );
);

rsm << Set Random Seed( 30624700 );
rsm << Make Design( 2 );
rsm << Set Axial Choice( 4 );
rsm << Center Points( 0 );
rsm << Make Table;

dt = Current Data Table();

// Set the response here
yvals = { 1.23, 0.98, 1.05, 0.76, 1.12, 1.23, 0.98, 1.05, 0.76, 1.12, 1.23, 0.98, 1.05, 0.76};
dt:Y << Set Values( yvals );

///////////////////////////
/////// Fit the RSM ///////
///////////////////////////

// Fit the RSM
fm = dt << Fit Model;
fls = fm <<  Run;


I got as far as getting the data table with the factors and inserting some dummy yvals. I can fit the quadratic model, and run that. It seems that I get some sort of a report object, but I want to use the "Prediction Profiler", "Maximize desirability", and "Remember" the optimal. I want to add those suggested optimal factors into the data table. These keywords are all found in the Scripting Index, but I cannot figure out how to make this work in JSL.

Any help would be super appreciated! Thank you so much.

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Trying to JSL script and get the maximum desirability from RSM design

I think you have to find a reference to the profiler platform. You can do it by finding reference to the Prediction Profiler outline box and then using << Get Scriptable Object

profiler_ob = (Report(fls) << XPath("//OutlineBox[@helpKey='Profiler']"))[1];
pf = profiler_ob << Get Scriptable Object;

You should also be able to get the reference via report subscripting

profiler_ob = Report(fls)[OutlineBox("Prediction Profiler")];
pf = profiler_ob << Get Scriptable Object;

After that you can use pf as you would Profiler object, for example

pf << Maximize Desirability;
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Trying to JSL script and get the maximum desirability from RSM design

I think you have to find a reference to the profiler platform. You can do it by finding reference to the Prediction Profiler outline box and then using << Get Scriptable Object

profiler_ob = (Report(fls) << XPath("//OutlineBox[@helpKey='Profiler']"))[1];
pf = profiler_ob << Get Scriptable Object;

You should also be able to get the reference via report subscripting

profiler_ob = Report(fls)[OutlineBox("Prediction Profiler")];
pf = profiler_ob << Get Scriptable Object;

After that you can use pf as you would Profiler object, for example

pf << Maximize Desirability;
-Jarmo

Re: Trying to JSL script and get the maximum desirability from RSM design

Amazing! Thank you

Recommended Articles