[SciPy-User] Any least-squares solver handles complex data/coefficients?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[SciPy-User] Any least-squares solver handles complex data/coefficients?

Neal Becker
Subject says it all

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any least-squares solver handles complex data/coefficients?

Matt Newville

On Fri, Jul 21, 2017 at 1:54 PM, Neal Becker <[hidden email]> wrote:
Subject says it all


I believe the answer is No, all work with (double precision) real numbers.  Of course, you can map 2 variables to real and imaginary parts of a complex number yourself.

--Matt



_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Any least-squares solver handles complex data/coefficients?

Robert Kern-2
In reply to this post by Neal Becker
On Fri, Jul 21, 2017 at 11:54 AM, Neal Becker <[hidden email]> wrote:
>
> Subject says it all

Not quite. Linear or nonlinear? If linear, then np.linalg.lstsq() works with complex matrices and vectors just fine.

If nonlinear, then no, you will have to convert the vector of real parameters to the complex parameters to pass through your model code.

--
Robert Kern

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user
Loading...