cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Riaz90Nawaz
Level II

Help in JSL scripting of Model Driven Multivariate Control Chart

Hi All,

I am planning to write a generic JSL script to fetch the data (containing multiple columns) from a file and perform Model Drive Multivariate Control Chart for Continued Process Verification purpose in my organization. Here, I am specifically looking to code for T2 control chart, score plot and then to display contribution plots for out of control points from the control chart. Basically, I would like to code the above mentioned requirements in one script so that to avoid redundancies of charting and exporting every time for obvious benefits

 

Appreciate if someone can support on this and guide me to proceed further. 

 

Note: I tried doing this manually from the Menu option of Model Driven Multivariate Control Chart ("Quality and Process") and saving the script to data table. I would like to make it more generic so that I can use it with any data table. Especially, with Contribution plots, I am unable to crack it at the moment as the system won't allow to display unless and until I select the out of control points manually from the T2 Control chart. Also, with the column names, when I am trying to code it with "Get Column Names" and use it in the Process function inside MDMVCC, it's not working. For example, Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ), instead of explicit mention of all column names every time, I would like to perform the analysis for all the columns from the data table.

 

Thanks in advance !!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

This might give some ideas how to get going (this should be made more robust)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Flight Delays.jmp");
dt << Clear Row States;
cols_of_interest = dt << get column names(Continuous, "String");

obj = dt << Model Driven Multivariate Control Chart(
	Process(Eval(cols_of_interest))
);

obj << T Square Plot(Save Values);
new_cols = Associative Array(dt << get column names(Continuous, "String"));
new_cols << Remove(Associative Array(cols_of_interest)); // T2 column


// get UCL (should be made more robust)
ucl_value = ((Report(obj)[OutlineBox("T² Limit Summaries")] << Child)[3] << Get)[1];
alarm_rows = Loc(dt[0, new_cols << get keys] > ucl_value);

dt << Select Rows(alarm_rows);
wait(0);
obj << T² Plot(Contribution Plot for Selected Samples(alarm_rows));
dt << Clear Select;
-Jarmo

View solution in original post

6 REPLIES 6
jthi
Super User

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

Do you want to have final report which has the contribution plots next to the control chart?

jthi_0-1685610934506.png

 

-Jarmo
Riaz90Nawaz
Level II

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

Hi Jthi, 

 

This will also work. Along with this contribution plots, I would like to add Score Plot with 95% Ellipse coverage and preferably to save the T2 values and Contributions. 

 

Kind Regards,

Riaz90Nawaz
Level II

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

Forgot to add one important point. I want contribution plots only for those which are out of control limit as per the T2 Control chart

jthi
Super User

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

This might give some ideas how to get going (this should be made more robust)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Flight Delays.jmp");
dt << Clear Row States;
cols_of_interest = dt << get column names(Continuous, "String");

obj = dt << Model Driven Multivariate Control Chart(
	Process(Eval(cols_of_interest))
);

obj << T Square Plot(Save Values);
new_cols = Associative Array(dt << get column names(Continuous, "String"));
new_cols << Remove(Associative Array(cols_of_interest)); // T2 column


// get UCL (should be made more robust)
ucl_value = ((Report(obj)[OutlineBox("T² Limit Summaries")] << Child)[3] << Get)[1];
alarm_rows = Loc(dt[0, new_cols << get keys] > ucl_value);

dt << Select Rows(alarm_rows);
wait(0);
obj << T² Plot(Contribution Plot for Selected Samples(alarm_rows));
dt << Clear Select;
-Jarmo
Riaz90Nawaz
Level II

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

Hi Jarmo,

 

Thank you so much. This will work. 

I shall modify the code further as per my requirements.

 

Highly Appreciate your prompt support on this. 

Thank you once again !!

 

Take Care,

KR,

 

 

Riaz90Nawaz
Level II

Re: Help in JSL scripting of Model Driven Multivariate Control Chart

Hi Jarmo/jthi, 

 

I need one more help on this part. 

 

I would like to have one generic script on the similar lines what you have suggested, but this time, the model driven multivariate control chart should use some benchmark models (either PCA or PLS) to fix the control limit. The reason is, for continued process verification purpose, once we fix the limit (calculated from the historical dataset without any outliers), the future batches have to be monitored against this limit. Currently, what's happening is, every time when this script is run, it generates new control limit (for obvious reasons) as the dataset is differing.

 

So, the first part is to fix the control limit (all the historical/golden dataset should fall below the control limit) and to do this, is it possible to develop a model with cross-validation to finalize the number of components so that the data-points fall below the control limit (off course, after removing the outliers)? The tricky part here I am facing, even though the so-called outliers are removed, every time the MDMVCC gives one or other data point beyond a control limit (as the dataset is changing).  This has to be fixed. 

second part is to run this script (with fixed control limit) on the subsequently manufactured batches to identify any excursions in the variables as part of CPV activity.

The overall idea is to have a generic MDMVCC script (from a benchmark model) which can predict/identify the outliers/variations with good accuracy. 

 

Appreciate if you can guide me or throw some more light on this request. 

 

Thanks in advance !!

KR,

Nawaz