Choose Language Hide Translation Bar
Highlighted
Community Trekker

## 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
Highlighted
Super User

## Re: Use of the ifmin function

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

4 REPLIES 4
Highlighted
Super User

## Re: Use of the ifmin function

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

Highlighted
Staff

## 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"

);

Highlighted
Community Trekker

## Re: Use of the ifmin function

Thanks.  That's a big help.

Highlighted
Community Trekker

Works perfect!

Thanks