Re: New book: Statistics - A Maxima Companion
Robert Dodier <[email protected]> Sun, 5 Jul 2026 11:10:39 -0700
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CAAsY_sRCUZ1Wy38ZVfHf9acwakYssQv=v172iM-oa0E0GH1gAQ@mail.gmail.com> |
Wolfgang, a few more thoughts about statistics with Maxima. Another context in which the symbolic and numerical aspects intersect is in parameter estimation. Very generally, a conventional approach is to construct a likelihood function and then look for parameter values which maximize the likelihood. A likelihood function is very easily constructed as something along the lines of L: product (pdf_something (x[k], param1, param2, ...), k, 1, length (x)); where x is a list of values (typically but not necessarily numeric) and pdf_something is some specific density function with parameters param1, param2, etc. For example x: [ 11, 13, 29, 17, 19, 23, 4, 7 ]; L: product (pdf_normal (x[k], mu, sigma), k, 1, length (x)); and then looking at log(L) with logexpand = true, contour plots of log(L), looking at partial derivatives, verifying that the minimum of log(L) coincides with the sample mean and standard deviation, etc. I first got interested in Maxima because I was trying to compute survival functions for some kinds of parametric survival models; the survival function is defined in terms of an integral, and I had reached the limit of what I could do with pencil and paper. It is a specialized topic, but anyway parametric survival models are a "neat" application of computer algebra, as several quantities of interest are defined, starting from a hazard function, i.e., p(T in interval [ t, t + dt ] given T > t) where T is the time of death or failure. Likewise one could start with a pdf and derive the cdf, expected value, moments, etc. in terms of the pdf via whatever integrals are needed. That could be a win for, let's say, distributions defined piecewise or otherwise clumsy to handle with pencil and paper. Finally, one could generate code for some derived function, suitable to be pasted into another program, Python, C/C++, etc. Just some ideas here, I've never gotten around writing this stuff down and working out the details, maybe someday. All the best, Robert