[SciPy-User] estimation problem

Neal Becker ndbecker2 at gmail.com
Fri Jul 15 13:39:16 EDT 2011


josef.pktd at gmail.com wrote:

> On Fri, Jul 15, 2011 at 12:58 PM, Neal Becker <ndbecker2 at gmail.com> wrote:
>> I have a known signal (vector) 'x'.  I recieve a vector 'y'
>>
>> y = F(k x) + n
>>
>> where n is Gaussian noise, and k is an unknown gain parameter.
>>
>> I want to estimate k.
>>
>> F is a known function (nonlinear, memoryless).
>>
>> What might be a good approach to try?  I'd like this to be an 'online'
>> approach - that is, I provide batches of training vectors (x, n), and the
>> estimator will improve the estimate (hopefully) as more data is supplied.
> 
> scipy.optimize.curve_fit
> 
> I would reestimate with the entire sample after a batch arrives using
> the old estimate as a starting value.
> 
> There might be shortcuts reusing and updating the Jacobian and
> Hessian, but I don't know of anything that could be used directly. (I
> don't have much idea about non-linear kalman filters and whether they
> would help in this case.)
> 
In my case, x, y, n are complex.  I guess I need to handle that myself 
(somehow).

Traceback (most recent call last):
  File "test_curvefit.py", line 378, in <module>
    run_line (sys.argv)
  File "test_curvefit.py", line 375, in run_line
    result = run (opt, cmdline)
  File "test_curvefit.py", line 244, in run
    popt, pcov = curve_fit (func, rcv_in[SPS*SI:SPS*SI+2*N], 
mod_out[SPS*SI:SPS*SI+2*N])
  File "/usr/lib64/python2.7/site-packages/scipy/optimize/minpack.py", line 426, 
in curve_fit
    res = leastsq(func, p0, args=args, full_output=1, **kw)
  File "/usr/lib64/python2.7/site-packages/scipy/optimize/minpack.py", line 283, 
in leastsq
    gtol, maxfev, epsfcn, factor, diag)
minpack.error: Result from function call is not a proper array of floats.




More information about the SciPy-User mailing list