Subscribe Bookmark RSS Feed

Platform Outputs into JSL Variables

clausa

Community Trekker

Joined:

Jan 16, 2014

Hello All

Can you pull factors/data/selections from a platform output into JSL?

I have what is currently 2 scripts that I would like to bring together. The first one imports an Excel file and creates a distribution script with "Fit Distribution (All)" so that the user can select the best type of fit and get the parameters. Can I get JSL to read what the user has selected and the parameters? I am thinking that I will need to create a new window via JSL with the distributions and fits (vs right now I send a script to the data table created by opening the Excel file and then run it) and then have a "proceed" button below it. I do not know what to have this button do in order to get what box is selected and the corresponding parameters, or note that no box is selected so I can run a random sampling or discrete sampling via a matrix vs a continuous fit function.

I am doing a Monte Carlo and need each of the types of fit and parameters to do the random function for each.

Thank you.

4 REPLIES
clausa

Community Trekker

Joined:

Jan 16, 2014

Bump.

I want to get the data in red below back into JSL. I know how to have JSL create the below, but not to get the fit function(s) the user selected and then the paramters for that function back into JSL, for each distribution. Thanks.

5950_Distibution with continuous fit example.png

clausa

Community Trekker

Joined:

Jan 16, 2014

Changed title to see if I can get some help. The data has to be there, but I have not been able to get it. I have tried playing with the "Show Properties" function when creating the display window, but cannot figure out how to pull back what is checked and the the parameter values. If I was creating my own check box list and table I could get them, but not with JMP doing it... Creating it myself is not an option as I need the platform to do the work.

Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Hi Claus,

I'm still working to figure out how to get which check box is checked.

However, if you're counting on JMP selecting the best fit, since we sort this table by ascending AICc it will always be the first one and something like this will work:


dt=open("$SAMPLE_DATA/Big Class.jmp");



dist= dt << Distribution(


  Continuous Distribution( Column( :height ), Fit Distribution( All ) )


);



r=report(dist);



disttype=r[outline box("Compare Distributions")][tablebox(1)][StringColBox(1)]<< get (1) ;



paramMatrix=r[outline box("?"||disttype)][outlinebox(1)][tablebox(1)][numberColBox(1)] << get as matrix;




paramList=r[outline box("?"||disttype)][outlinebox(1)][tablebox(1)][numberColBox(1)] << get;



show(disttype, paramMatrix, ParamList);


-Jeff

-Jeff
ms

Super User

Joined:

Jun 23, 2011

There seems to exist an internal order of distributions that is maintained whatever the outcome of the automatic sorting. If that order is stable it can be hardcoded like in the example below. However, beware that the number of distributions as well as the order (and spelling?) may change in future versions of JMP.

This code works for me in JMP 11. The selected distributions and parameter estimates are stored in an associative array as keys and values respectively, but there are of course other options (e.g. data tables).

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dist = Distribution( Continuous Distribution( Column( :weight ), Fit Distribution( All ) ), Histograms Only );

// List of the distribution names in their "true" order

L = {"Normal", "LogNormal", "2 parameter Weibull", "Exponential", "Gamma", "Johnson Su", "Johnson Sl", "Generalized Logarithm", "Extreme Value",

"Normal 2 Mixture", "Normal 3 Mixture"};

rdist = Report( dist );

// Add button with script. Click after manual selection.

rdist << prepend(

  Button Box( "Click when done",

  // Find the true position of selected items (not what the automatically sorted table shows)

  m = [];

  For( i = 1, i <= 11, i++,

  m = m || (rdist[Outline Box( "Compare Distributions" )][1][1] << get( i ))

  );

  seldist = If( N Row( Loc( m ) ) > 1,

  L[Loc( m )],

  Eval List( {L[Loc( m )]} )

  ); // Selected distribution(s)

  aa = Associative Array(); // For storing parameter estimates

  // Insert values

  For( i = 1, i <= N Row( Loc( m ) ), i++,

  aa << insertitem( seldist[i], Matrix( rdist[Outline Box( "Fitted " || seldist[i] )][Number Col Box( "Estimate" )] << get ) )

  );

  Show( Seldist );

  Show( aa );

  )

);