forum.alglib.net
http://forum.alglib.net/

Polynomialfit Y intercept
http://forum.alglib.net/viewtopic.php?f=2&t=421
Page 1 of 1

Author:  jamdaman5000 [ Thu Aug 25, 2011 10:04 pm ]
Post subject:  Polynomialfit Y intercept

Hello all,

I am new to alglib, but I am getting the hang of it pretty quickly. Well done! I am trying to write a program that models some data with a 6th order polynomial. I am trying to get a good fit, and I have modeled this data in excel, however in excel I can put a Y intercept on my polynomial trend line.

My question is: How do I specify a Y-intercept of '0' with alglib? I am writing the code in C#

Thanks!
Jameson

Author:  Doug Jenkins [ Fri Aug 26, 2011 4:25 am ]
Post subject:  Re: Polynomialfit Y intercept

In the VBA version, the PolynomialFitWC routine allows fitting with constraints and weights, which will allow you to do what you want. There is an Excel based version available here:

http://newtonexcelbach.wordpress.com/20 ... functions/

Author:  jamdaman5000 [ Fri Aug 26, 2011 1:29 pm ]
Post subject:  Re: Polynomialfit Y intercept

I'm not familiar with the polynomialfitwc function. What parameters do I need to put in there to get it to intercept at 0?

Author:  Doug Jenkins [ Sat Aug 27, 2011 10:13 am ]
Post subject:  Re: Polynomialfit Y intercept

Have you looked at the manual?

http://www.alglib.net/translator/man/ma ... omialfitwc

Author:  jamdaman5000 [ Tue Aug 30, 2011 4:13 pm ]
Post subject:  Re: Polynomialfit Y intercept

Yes, I have thoroughly read about the Polynomialfitwc function. I believe I have it correct now. I have my XC and YC values as an array of only one element to make my function's Y = 0 at X =0.

double XC[] = {0};
double YC[] = {0};

I am wondering if each element in the XC array corresponds to the same index in the X array. What happens when I add more values to the arrays?

Author:  Sergey.Bochkanov [ Mon Sep 05, 2011 4:06 pm ]
Post subject:  Re: Polynomialfit Y intercept

No, there is no correspondence between XC and X arrays (or Y and YC arrays). There is one-to-one correspondence between X and Y, XC and YC.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/