forum.alglib.net

ALGLIB forum
It is currently Sat Sep 07, 2024 11:30 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Polynomialfit Y intercept
PostPosted: Thu Aug 25, 2011 10:04 pm 
Offline

Joined: Thu Aug 25, 2011 10:00 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: Polynomialfit Y intercept
PostPosted: Fri Aug 26, 2011 4:25 am 
Offline

Joined: Sun May 16, 2010 11:42 pm
Posts: 63
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/

_________________
Doug Jenkins
http://newtonexcelbach.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Polynomialfit Y intercept
PostPosted: Fri Aug 26, 2011 1:29 pm 
Offline

Joined: Thu Aug 25, 2011 10:00 pm
Posts: 3
I'm not familiar with the polynomialfitwc function. What parameters do I need to put in there to get it to intercept at 0?


Top
 Profile  
 
 Post subject: Re: Polynomialfit Y intercept
PostPosted: Sat Aug 27, 2011 10:13 am 
Offline

Joined: Sun May 16, 2010 11:42 pm
Posts: 63
Have you looked at the manual?

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

_________________
Doug Jenkins
http://newtonexcelbach.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Polynomialfit Y intercept
PostPosted: Tue Aug 30, 2011 4:13 pm 
Offline

Joined: Thu Aug 25, 2011 10:00 pm
Posts: 3
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?


Top
 Profile  
 
 Post subject: Re: Polynomialfit Y intercept
PostPosted: Mon Sep 05, 2011 4:06 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 922
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group