From: "Marshall L. McCall" Subject: non-linear least squares and scientific graphing Here at last are the responses to my request for information about software which will do both non-linear least squares and publication-quality graphics. Except for a few cases where contact information is essential, I have deleted names in case privacy is an issue. In essence, it appears that Kaleidagraph is popular at the low-cost end, and IDL at the high-cost end. There are mixed feelings about Igor. I must say, though, Igor may be a powerful force to reckon with once the new version comes out with its support for 3D graphics. Thank you to all for your help with this important issue. Best wishes, Marshall McCall York University Canada fs300050@sol.yorku.ca ------------------------------------------------------------------------ Marshall McCall wrote to ask about a program that does nonlinear least squares fitting and graphing. Check out KaleidaGraph (Synergy Software). I have used the nonlinear l.s. fit fairly heavily and found it to be pretty easy to use and flexible. You can specify up to nine parameters for the fit, and you have the option to specify partial derivatives or not for each parameter. The graphing is simple and powerful. However, three-dimensional graphs are not available in this package. This program should definitely be on your list of programs to check out. ----------------------------------------------------------------------- I have ported pgplot to the mac and it runs with LS fortran 2.1, LS PPC fortran 1.1, and I think LS fortran 3.3. The port is crude and only supports 8 colors, currently. I've just released it on a limited basis over the last month, but I can send you email of the mac specific files that you need if you are interested. Sincerely, John John Salmento regular address: Research Assistant Lehigh University Room B-261, Imbt Building Energy Research Center email: js0p@lehigh.edu 117 ATLSS Drive phone: (610) 758-6285 Bethlehem PA, 18015 fax: (610) 758-5959 ----------------------------------------------------------------------- I use IDL in the analysis of astronomy data and note the following points which may interest you (especially item 9). 1. The IDL environment includes a programming language which is similar to FORTRAN 90. The language is vectorized. Compilation is performed on execution, and program debugging is interactive. 2. The algorithms (called procedures) are platform independent and can be ported easily. 3. The interactive environment is very useful in analysis. The user can also read data files, perform analysis and produce plots interactively. Complete daily sessions can be stored into a journal file. 4. Relatively easy to master. Documentation and support is excellent. 5. 2D and 3D graphics facilities. 6. Most standard file formats are supported. 7. The package includes image processing utilities. 8. IDL procedures for astronomy applications (e.g., FITS readers) are available in astronomy FTP sites. 9. Includes numerical and statistical libraries with an implementation of the Levenberg-Marquardt algorithm for non-linear optimization. The user provides the function, derivatives and parameter estimates (guesses) in the form of a procedure. 10. Plots are journal quality with full postscript support. 2D graphing is at least comparable to SM. 11. Text labels can be easily inserted for point identification. IDL contact info: Research Systems, Inc. (301) 595-3790 I think the price for a Mac version is ~$1500. ----------------------------------------------------------------------- DeltaGraph Pro from DeltaPoint (deltapoint@aol.com) allows user-defined curve fits for X-Y pairs with labels for each data point. It also does 3D graphing. I use DeltaGraph quite a bit, but I don't have much experience with these particular features. I'll refer you directly to DeltaPoint for your specific questions. ------------------------------------------------------------------------ Regarding your request for information on nonlinear fitting and graphing software. I have been using proFit for several months now and am very happy. The feature I like best is that you can use a Pascal-like language to write fitting functions within the program, or you can link to precompiled C or Pascal routines, using your favorite compiler. I will guess that you could also do that with Fortran routines. It will then perform nonlinear fitting via a variety of criteria and allows one to set limits on fitting parameters. The interface is very easy and graphs look nice and are easily manipulated. I don't know about labeling points directly, but I am certain that you could use their built-in programming language to do that relatively easily. I "think" that it does not currently support 3D plots. Finally, I have found the PPC version to be VERY fast in curve fitting. Try either of the following contacts. The latter person has been very helpful with technical questions. By the way, I have no connection to the company... Deborah Larsen Product Marketing csp@netcom.com Mark Oxenham | e-mail: mark@cherwell.com Technical Support | Phone: +44 (0)1865 784800 Cherwell Scientific Publishing | Fax: +44 (0)1865 784801 ---------------------------------------------------------------------- Like you, I have used a nonlinear least-squares fitting procedure written in Fortran for many years and on a succession of mainframes and workstations. It is partly my own and partly taken from programs by colleagues dating back to the late '50s, with a later inclusion of the Marquardt algorithm. I have never tried to adapt this procedure to the Macintosh. However, there is a program I have used frequently for producing publication-quality graphs on the Mac which does allow for nonlinear least-squares fitting. I am speaking of KaleidaGraph, sold by Synergy Software of Reading, PA, (215) 779-0522. I think the price is around $150. Note that this is a 2D program; I have not seen any way to use it for 3D fits and plots, but in case you might be interested here is a bit of detail. The program has built-in fitting procedures including cubic splines, etc., but the instruction book has this to say about user- defined fits: "Applying a User-Defined Curve Fit --------------------------------- "Non-linear curve fitting is accomodated in KaleidaGraph through the General curve fit function. The General curve fit allows you to define your own equation and apply a fit to the data, using the Levenberg-Marquardt algorithm." The chapter goes on to explain how to define the curve, weight the data, make the fit, and display the data and the fit. The program calculates errors in the parameters of the fit. KaleidaGraph is fairly easy to use and has a very large range of options of styles for text (including super/subscripts and Greek & mathematical symbols if you have the necessary fonts), points, curves, and graph axes, ticks, and labels. The instruction books are usually clear about telling you how to do a particular operation, but it sometimes takes a bit of experimentation to get exactly what I want. Also, the database part of the program is not as full-featured as Excel. But its plotting routines easily produce professional-looking graphs; I have used them for more than one publication. ----------------------------------------------------------------------- Concerning your request for suggestions for non-linear least-squares fitting and scientific plotting software: I'd suggest (strongly) that you take a long look at IDL. IDL does not have the smooth click-and-drag plotting and labeling features that distinguish Igor. However, with a bit more work (that is, more typing on the keyboard) you can certainly create publication-quality plots in any style you require. IDL is happy to deal with multi-dimensional data, too, and the 3D plotting (including volumetric displays) is very good. Again, you end up doing more grunt work to create a 3D plot in IDL than in, for instance, the sexy Spyglass programs, but the end results are equally good. It has very strong image-processing capabilities, too, if that makes any difference to you. Where IDL really pays off is that you are not limited computationally. It is extremely strong at dealing with array data of any kind, and has a wide variety (I mean really wide) of built-in capabilities. Non-linear fits? Basically anything you want. As long as you are doing computational rather than symbolic work (where Mathematica is a better choice), you should find that you do whatever you need to do in IDL. IDL runs on Unix, WIndows, and Macintosh, and you can move both programs and data among different machines with no problem. It runs extremely well on a high-end Mac: computations are faster than on a garden-variety Sun, although the Sun wins on I/O-intensive stuff. This sounds like a sales pitch, but IDL really is a wonderful piece of software for a working scientist. It certainly takes some getting used to, and it isn't cheap (about $1500 for the Mac), but the payoff is worth it. As they say in the movie business, it's got legs. ------------------------------------------------------------------------ I think you should take a look at KaleidaGraph. It's extremely flexible in what it can do in terms of data manipulation and plotting and simple enough to use to be of real use. It has non-linear least squares fitting capabilities, which from my experience are very fast as well as accurate. ________________________________________________________________________ My experience with such packages is virtually non-existent, yet I have taken a peep at a package that you didn't mention in your Info-Mac message, and you might give it a look. DeltaGraph Professional by DeltaPoint describes itself as a data graphing product for both business and scientific use, and it generally gets very good reviews for its graphing ability. I was surprised to find that it had a nifty, easy-to-use general-function least squares-fitting ability. It was not appropriate for my use in an introductory physics lab at City College, because the interface is too much for a student to cope with with the limited time that they have. It should be quite usable though for someone with a little time to learn it. ----------------------------------------------------------------------- Although obviously biased, I think you would love Igor Pro once you got into it. You might tune into the comp.sys.mac.scitech group since someone recently asked for opinions of Igor Pro. Although Igor Pro does not do surface plots yet, the next version, 3.0, currently in beta, does support image and contour plots. You can also get info from: Voice: (503)-620-3001 FAX: (503)-620-6754 WWW site: http://www.wavemetrics.com/ Tech support: support@wavemetrics.com FTP site: ftp://d31rz0.stanford.edu/ Information: info@wavemetrics.com FTP site: ftp://ftp.wavemetrics.com/ Sales: sales@wavemetrics.com -Larry Hutchinson -WaveMetrics (creator of IgorPro) ----------------------------------------------------------------------- I use Kaleidagraph for producing graphs and doing nl-lsq-fits of simple functions that can be defined in essentially 1 line. The nonlinear fitting add-in that comes with Microsoft Excel is quite good, and it makes a reasonable attempt to extract confidence intervals but read the manual carefully on this point -- what you want if you are pedantic about statistics and what it tells you are not identical. If I were you I'd consider buying a fortran compiler (I'm quite a fan of the Langsys one for this sort of thing), comment out all the graphics stuff from your code and get it to output results by publishing text files of numbers. Then get your graphics program to subscribe to this dataset and draw it. People do rave about Igor pro, but it has always looked to me as though it would involve a bit of learning to use it to full spec.