turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Use of the ifmin function

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 8, 2015 2:31 PM
(3169 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 8, 2015 6:55 PM
(5439 views)

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

4 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 8, 2015 6:55 PM
(5440 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 9, 2015 1:02 AM
(3029 views)

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"

**)**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 9, 2015 5:36 AM
(3029 views)

Thanks. That's a big help.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 9, 2015 5:35 AM
(3029 views)

Works perfect!

Thanks