Fitting Data



Chris Maness <chris <at> chrismaness.com> writes:

> (%i169) lsquares_estimates(M,[L,n],L+.4*d=n*l/4,[l]);
> 
> `sublis': Bad 1st arg
> #0: lsquares_mse(data%=data,variables=[0.72,15],equation=0.73524 =
> 0.7725)(lsquares.mac line 259)
> #1:
lsquares_estimates(data=matrix([1,0.0381],[3,0.1371],[5,0.2158],
[7,0.3319],[9,0.4302],[11,0.5276],[13,0.6299],[15,0.72]),
variables=[0.72,15],equation=0.73524
> = 0.7725,parameters=[0.206],optional_args=[])(lsquares.mac line 243)

Looks like L, n, and l all have numerical values assigned to them,
but they need to be symbolic variables. 

You could try writing the function call as 

  lsquares_estimates (M, '[L, n], '(L + 0.4*d = n*l/4), '[l]);

i.e. quote stuff to prevent evaluation, but my advice is

  kill (L, n, l);

so they can't evaluate to numbers at all.

HTH

Robert Dodier