Click here to Skip to main content
15,890,670 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Real time peak identification Pin
peterchen31-May-11 22:11
peterchen31-May-11 22:11 
GeneralRe: Real time peak identification Pin
Wjousts1-Jun-11 8:22
Wjousts1-Jun-11 8:22 
AnswerRe: Real time peak identification Pin
MartinW13071-Jun-11 0:22
MartinW13071-Jun-11 0:22 
AnswerRe: Real time peak identification Pin
Skymir1-Jun-11 2:59
Skymir1-Jun-11 2:59 
AnswerRe: Real time peak identification [modified] Pin
Antonino Porcino1-Jun-11 5:56
Antonino Porcino1-Jun-11 5:56 
AnswerRe: Real time peak identification Pin
DMJ0011-Jun-11 10:12
DMJ0011-Jun-11 10:12 
GeneralRe: Real time peak identification Pin
largenqcd1-Jun-11 17:33
largenqcd1-Jun-11 17:33 
QuestionBest fit polynomial curve to non-continuous data points [Solved] Pin
Ian Shlasko23-May-11 4:43
Ian Shlasko23-May-11 4:43 
I'm sure there's a relatively-straightforward way to do this, but my research so far has been a bit overwhelming... Heavy statistics and calculus have never been one of my strengths...

Basically, I need to calculate a best-fit curve on a scatter graph... Points are not evenly spaced on either axis, and there's no cost function to work with (These are derivations of stock/bond price histories)... Just raw (X,Y) values.

I've been trying to work out an algorithm that'll start with a second-degree polynomial function, iterate through and minimize the difference, and then jump to third-degree if it's not within tolerance (And so on, up to a maximum degree). Juggling the data around is something I can do blindfolded, but there's one thing I can't figure out...

Given the polynomial coefficients ((a,b,c,d) -> y = a + bx + cx^2 + dx^3) and a function to determine the total difference across the curve (Or the total square difference, or whatever's needed), how do I adjust the coefficients for the next pass? I mean, how do I choose new values?

I was originally going to try to fix the highest-degree coefficient first, then drill down to the zeroth-degree one (I have a root-solving algorithm that I use for yield calculations - Was going to adapt that), but then I looked at it again with the proper amount of caffeine, and realized that solving one coefficient at a time wasn't going to work Smile | :)


SOLVED: See my reply below... Linear/Polynomial Regression
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

modified on Tuesday, May 24, 2011 9:41 AM

AnswerRe: Best fit polynomial curve to non-continuous data points Pin
_Erik_23-May-11 5:07
_Erik_23-May-11 5:07 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
Ian Shlasko23-May-11 5:20
Ian Shlasko23-May-11 5:20 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
_Erik_23-May-11 5:25
_Erik_23-May-11 5:25 
AnswerRe: Best fit polynomial curve to non-continuous data points Pin
Luc Pattyn23-May-11 5:20
sitebuilderLuc Pattyn23-May-11 5:20 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
Ian Shlasko23-May-11 6:02
Ian Shlasko23-May-11 6:02 
AnswerRe: Best fit polynomial curve to non-continuous data points Pin
Luc Pattyn23-May-11 6:12
sitebuilderLuc Pattyn23-May-11 6:12 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
Ian Shlasko23-May-11 7:28
Ian Shlasko23-May-11 7:28 
AnswerRe: Best fit polynomial curve to non-continuous data points Pin
Luc Pattyn23-May-11 7:50
sitebuilderLuc Pattyn23-May-11 7:50 
AnswerRe: Best fit polynomial curve to non-continuous data points Pin
Graham Toal23-May-11 9:54
Graham Toal23-May-11 9:54 
AnswerRe: Best fit polynomial curve to non-continuous data points Pin
Ian Shlasko23-May-11 9:58
Ian Shlasko23-May-11 9:58 
AnswerRe: Best fit polynomial curve to non-continuous data points Pin
Alan Balkany24-May-11 3:25
Alan Balkany24-May-11 3:25 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
Ian Shlasko24-May-11 3:41
Ian Shlasko24-May-11 3:41 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
Alan Balkany24-May-11 3:43
Alan Balkany24-May-11 3:43 
GeneralRe: Best fit polynomial curve to non-continuous data points Pin
Ian Shlasko24-May-11 3:46
Ian Shlasko24-May-11 3:46 
QuestionShortes pass find + walls bypassing Pin
alikalik14-May-11 22:22
alikalik14-May-11 22:22 
AnswerRe: Shortes pass find + walls bypassing Pin
Luc Pattyn15-May-11 2:43
sitebuilderLuc Pattyn15-May-11 2:43 
AnswerRe: Shortes pass find + walls bypassing Pin
dasblinkenlight15-May-11 23:11
dasblinkenlight15-May-11 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.