numeric icon indicating copy to clipboard operation
numeric copied to clipboard

Least square solution

Open paulhayes opened this issue 11 years ago • 6 comments

I wasn't sure where else to post this question. It's not technically a bug but more a missing feature.

I'm porting some code I originally wrote in python/numpy, into javascript/numeric.

I'm finding numeric very good so far, but I know need to find the least square solution for a non square matrix. In numpy this is achieved with numpy.linalg.lstsq, but there's no direct equivalent I could find in numeric.

Could you possibly offer me a short way of achieving this using numeric? I'm aware I can write my own least square solver, but as it's a common problem I thought maybe there's a way that I hadn't noticed by reading through the documentation.

Thank you for taking the time to help me.

paulhayes avatar Feb 05 '14 12:02 paulhayes

I'm intersted in this as well. I'm going to take a stab at a general Levenburg-Marquardt solver one of these days, haven't had the time or brain function lately. If anyone else is interested let me know.

On Wed, Feb 5, 2014 at 6:37 AM, Paul Hayes [email protected] wrote:

I wasn't sure where else to post this question. It's not technically a bug but more a missing feature.

I'm porting some code I originally wrote in python/numpy, into javascript/numeric.

I'm finding numeric very good so far, but I know need to find the least square solution for a non square matrix. In numpy this is achieved with numpy.linalg.lstsq, but there's no direct equivalent I could find in numeric.

Could you possibly offer me a short way of achieving this using numeric? I'm aware I can write my own least square solver, but as it's a common problem I thought maybe there's a way that I hadn't noticed by reading through the documentation.

Thank you for taking the time to help me.

Reply to this email directly or view it on GitHubhttps://github.com/sloisel/numeric/issues/53 .

reptillicus avatar Feb 05 '14 16:02 reptillicus

+1 On 2/5/2014 11:57 AM, Joe Meiring wrote:

I'm intersted in this as well. I'm going to take a stab at a general Levenburg-Marquardt solver one of these days, haven't had the time or brain function lately. If anyone else is interested let me know.

On Wed, Feb 5, 2014 at 6:37 AM, Paul Hayes [email protected] wrote:

I wasn't sure where else to post this question. It's not technically a bug but more a missing feature.

I'm porting some code I originally wrote in python/numpy, into javascript/numeric.

I'm finding numeric very good so far, but I know need to find the least square solution for a non square matrix. In numpy this is achieved with numpy.linalg.lstsq, but there's no direct equivalent I could find in numeric.

Could you possibly offer me a short way of achieving this using numeric? I'm aware I can write my own least square solver, but as it's a common problem I thought maybe there's a way that I hadn't noticed by reading through the documentation.

Thank you for taking the time to help me.

Reply to this email directly or view it on GitHubhttps://github.com/sloisel/numeric/issues/53 .

— Reply to this email directly or view it on GitHub https://github.com/sloisel/numeric/issues/53#issuecomment-34209152.

Ravenwater avatar Feb 05 '14 18:02 Ravenwater

+1

sebleedelisle avatar Feb 06 '14 13:02 sebleedelisle

Hi again, I've written a least square solver that should be easy to integrate into the numeric library. Sorry for not forking the project, and doing a pull request, but I've run out of time to spend on this.

https://gist.github.com/paulhayes/8888586

I've tested it, and it does work. Promise!

paulhayes avatar Feb 08 '14 19:02 paulhayes

Finally got around to this, here's a demo page: http://josephmeiring.github.io/jsfit/

and here is the repo: http://josephmeiring.github.io/jsfit/

Its working pretty good for me, let me know if you are using it or if you find some bugs.

reptillicus avatar Nov 16 '15 22:11 reptillicus

Hi @josephmeiring did you realise you posted the github.io page twice?

paulhayes avatar Dec 07 '15 15:12 paulhayes