Subject: ugly weird expression to be passed to R??
From: dlakelan
Date: Thu, 31 Jul 2008 11:28:14 -0700
Robert Dodier wrote:
> On Mon, Jul 28, 2008 at 4:47 PM, dlakelan <dlakelan at street-artists.org> wrote:
>
>> Does anyone have a suggestion for how to clean up this expression in
>> maxima before outputting to fortran?
>
> Try "optimize" which looks for common subexpressions.
>
> By the way, since Maxima includes a numerical minimization algorithm
> (LBFGS) I think it is worth a try to see if you can do the whole problem
> in Maxima. If you can send me some example data I will give it a try.
Thanks to all who helped with my expression. It turned out that I had to
tune my model, and wound up with some other ugly expressions, but the
use of scanmap(factorsum,expr) was extremely helpful in simplifying things.
I did try using lbfgs to get the maximum likelihood estimates, and it
did work, even with 800+ data points in the likelihood expression. If I
work more on this problem, I may try doing a MCMC sampling method for
getting a bayesian posterior sample from the coefficients. Has anyone
done anything like that in maxima before?
Thanks,
Dan