Subject: LBFGS for use in large maximum likelihood problem
From: dlakelan
Date: Fri, 08 Aug 2008 15:57:00 -0700
Hi Robert, and others who are interested.
The following code gives a much simpler example of the use of lbfgs in a
maximum likelihood problem where a symbolic sum noun does not suffice,
but an explicit sum does...
-----------
kill(all);
load(distrib);
load(lbfgs);
data_test:random_normal(10,1,100);
pdf:exp(-(x-m)^2/(2*s^2))/(s*sqrt(2*%pi));
loglikelihood:'lsum(log(subst('x=x,pdf)),x,data_test);
lbfgs(-loglikelihood,[m,s],[9,2],.00025,[1,0]); /* ** THIS FAILS ** */
/* the error above is something like "non variable 2nd argument to diff
9.0" */
explicit_expr:ev(-loglikelihood,nouns,infeval);
lbfgs(explicit_expr,[m,s],[9,2],.00025,[1,0]); /* ** THIS WORKS ** */