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
- :
- I know this is a bit of a stretch, but is there an...

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

Aug 30, 2012 10:37 AM
(2616 views)

The Ei(X) function is (I guess) a fairly rare function. At least I've never had to deal with it before. But it has popped up in an analysis I am doing, I am wondering if there is anyway to encode it into a formula in JMP. Clearly, it isn't in there by default, but is there a way to manually enter this:

- Into a formula column? Thanks in advance.
- --SurfaceThought

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Sep 7, 2012 6:05 AM
(3160 views)

OK here's a JSL implementation of the Fortran code. The code runs, but you'll need to test it out to make sure the numbers are good. It's pretty much a straight conversion of the Fortran program. Interesting exercise!

13 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Aug 30, 2012 11:31 AM
(2118 views)

Not so rare. The MATLAB page gives a lot of approximations, so there may be something there that can be ginned up from the functions in JMP.

See http://mathworld.wolfram.com/ExponentialIntegral.html

Also look at the GNU library (http://www.gnu.org/software/gsl/manual/html_node/Exponential-Integral.html). You could use this to generate an R object, and then pull that into JMP.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Aug 30, 2012 12:16 PM
(2118 views)

Steve: Thanks for the quick reply:

I have looked at the approximations, and I am not sure that they will work for my purposes. The Taylor series approximation:

is apparently slow to converge, and would need k = 30 in order to have three decimal point precision at the levels of x I would be dealing with. In addition, the wiki page states :

This formula can be used to compute with floating point operations for real between 0 and 2.5. For , the result is inaccurate due to cancellation.

Which is rather ominous, seeing as I will be dealing with x values larger than 2.5. I understand that "floating point operations" just means that the computing device rounds off to a certain number of decimal points after each step of the calculation. Does JMP use floating point operations? Is there even an alternative? I suppose I could transform x in some way so that the values would fit in between 0 and 2.5.

There is another approximation that is divergent, which isn't great because it is divergent, but also because the error seems to be very large for small values of x (less than one), which is also within the range of x values I may use. If I need to use this approximation, then I will have to, but I would like to save it for last option.

The problem with calculating the Ei(X) and importing it into JMP, is that the argument of the exponential integral includes a parameter that I want to solve for using non-linear least squares. Therefore it needs to actually be encoded into JMP so that JMP can change the parameter in order to iteratively solve for it.

Is it really true that there is no INT() function in JMP?

Thanks for the help,

--SurfaceThought

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Aug 30, 2012 12:38 PM
(2118 views)

Not enough of a JMP user to know--much more of a SAS person. But integration is not something SAS is very strong about at the function level, although there are some PROC FCMP approaches and macros that I know of.

What I thought was a possibility was using some of the gamma functions associated with Ei(x), like the incomplete gamma function and appropriately scaling the input and output.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Sep 4, 2012 10:46 AM
(2118 views)

Steve,

Using the gamma function to calculate Ei(x) is so tantalizing, and so close to the solution, but after playing around with it I unfortunately think that it will not work. The Gamma function as given in JMP allows you to compute either the complete gamma function or the lower incomplete gamma function. In other words, it allows you to integrate from zero to infinity, or zero to some positive x value, but you cannot change to lower limit of integration: it is always zero. The Exponential integral is related to the *upper *incomplete gamma function, as in order to calculate it you need to have a variable lower limit of integration and integrate up to infinity. Because the gamma function as it stands in JMP does not allow for a variable lower limit of integration, I think that this approach simply will not work.

Thank you though,

--SurfaceThought

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Sep 4, 2012 10:57 AM
(2118 views)

Yeah, the more I looked at it (the incomplete gamma), the less happy I was as well, and I couldn't find an easy way to appeal to symmetry, especially for these functions.

Oh and as far as translating FORTRAN to JSL, the word "doomed" is quite appropriate. The MATLAB code would be easier to translate, I think.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Aug 30, 2012 5:32 PM
(2118 views)

In JMP use Floor(x) to get what is Int(x) in Excel.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Sep 4, 2012 10:46 AM
(2118 views)

Sorry, that was dumb of me. I meant like a integrate function, not like a round to integer function.

-- SurfaceThought

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Sep 3, 2012 5:13 PM
(2118 views)

Here's a Fortran implementation: http://people.sc.fsu.edu/~jburkardt/f77_src/toms385/toms385.html

Shouldn't be too hard to convert to JSL.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Sep 4, 2012 10:52 AM
(2118 views)

This is where I get way in over my head

I am much more of a statistician than a programmer ( although I am not much of either ). How close is FORTRAN to JSL? I have no knowledge of it. If I copy and pasted the entire thing into a JSL script window, and kept on trying to run it and fixing errors as they came up, would I be successful or would I be doomed without some knowledge of FORTAN?

Thanks,

--SurfaceThought