Hi. I've been writing scripts to automate visualization of distributions, fitting distributions, and reporting cpk. I just finished a long one, and really found a lot of disparities in how the names of some distributions must be used. This required a significant amount of debugging. My ask is not a small one, but I would love if JSL could make usage of distribution names more consistent in order to make writing scripts more efficient and less confusing. I will provide examples below.
My script takes a list of distribution names {"Exponential", "Normal 2 Mixture", "Johnson SU", ...} and first generates a table of random data with one column for each distribution. It then creates distribution plots, fits the data, extracts the fit parameters for each distribution. It also uses the Process Capability platform to compute cpk. I rely a lot on creating JSL Quotes then substitution of the desired distribution name to get the exact code I need.
Issues:
- When I want to generate matrices of random data initially, I need to use "Exp" instead of "Exponential" and "Normal Mixture" instead of "Normal 2 Mixture".
</CODE><CODE class=" language-jsl">J(100, 1, Random<FONT color="#FF0000"><STRONG>Exp</STRONG></FONT>(...));<BR />J(100, 1, Random<FONT color="#FF0000"><STRONG>NormalMixture</STRONG></FONT>(...));<BR />J(100, 1, Random<FONT color="#FF0000"><STRONG>JohnsonSB</STRONG></FONT>(...));
- On the other hand, to fit a distribution to my data, I need to use "Exponential" instead of "Exp", "Normal 2 Mixture" instead of "Normal Mixture" and "Johnson" instead of "Johnson SB":
dt << Distribution(
Continuous Distribution(
Column(:colname1),
Fit <FONT color="#FF0000"><STRONG>Exponential,</STRONG></FONT>
Fit <FONT color="#FF0000"><STRONG>Normal 2 Mixture,</STRONG></FONT>
Fit <FONT color="#FF0000"><STRONG>Johnson</STRONG></FONT>
)
)
- And again another naming scheme for the Normal 2 Mixture in the Process Capability platform:
pc = dt << Process Capability(
Process Variables(
:colname1 & Dist(<FONT color="#FF0000"><STRONG>Exponential</STRONG></FONT>),
:colname2 & Dist(<FONT color="#FF0000"><STRONG>Mixture of 2 Normals</STRONG></FONT>),
:colname3 & Dist(<FONT color="#FF0000"><STRONG>Johnson</STRONG></FONT>),
)
)
I had initially hoped I could just provide my script a list of distribution names to try, then have a for loop cycle through the list, adding the specific name to a JSL Quote, and then executing. Instead I found out the hard way that I needed to create several if clauses to fix the distribution names for each different operation prior to substitution.
It would be great if all of this could be simplified by just using one set of distribution names for all functions and platforms. Thanks.
[Using JMP Pro 17.2.0]