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
mrvos0
Level I

Use of the ifmin function

I am running a Monte Carlo simulation using the JMP profiler.  I need to prevent one of the random Gamma distributions I'm using from returning a number greater than 120.  To do, I was trying to create an expression using the ifmin function so that the function returns the value of the Gamma distribution if the value is less than 120 and the function returns 120 if the value is greater than 120.  This is basically trying to create a truncated distribution similar to the way a truncated normal distribution is created.  Unfortunately, I've been unsuccessful in getting the ifmin function to work and have not been able to find any examples of the use of the function to use as a template. Can anyone give me some guidance on getting ifmin to work?


Here's what I've tried:  IfMin( Random 20*Gamma(10), 120, 120 )


All I get is 120 back from the function. If I change the order, I get the random Gamma back with lot of vaules greater than 120.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Use of the ifmin function

min(20 * Random Gamma(10), 120);

View solution in original post

4 REPLIES 4
pmroz
Super User

Re: Use of the ifmin function

min(20 * Random Gamma(10), 120);

ian_jmp
Level X

Re: Use of the ifmin function

And in general, if you want help with a function, try 'Help > Scripting Index', which gives the syntax and often an example.

In this case, for 'IfMin()':

Names Default To Here( 1 );

TomScore = 45;

JonScore = 47;

TimScore = 46;

lowestScorer = IfMin(

  TomScore,

  "Tom",

  JonScore,

  "Jon",

  TimScore,

  "Tim",

  "Noone"

);


mrvos0
Level I

Re: Use of the ifmin function

Thanks.  That's a big help.

mrvos0
Level I

Re: Use of the ifmin function

Works perfect!

Thanks