Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9060047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:07:26+00:00 2026-06-16T15:07:26+00:00

There are some related questions that I’ve come across (like this , this ,

  • 0

There are some related questions that I’ve come across (like this, this, this, and this) but they all deal with fitting data to a known curve. Is there a way to fit given data to an unknown curve? By which I mean, given some data the algorithm will give me a fit which is one function or a sum of functions. I’m programming in C, but I’m at a complete loss on how to use the gsl package to do this. I’m open to using anything that can (ideally) be piped through C. But any help on what direction I should look will be greatly appreciated.

EDIT: This is basically experimental (physics) data that I’ve collected, so the data will have some trend modified by additive gaussian distributed noise. In general the trend will be non-linear, so I guess that a linear regression fitting method will be unsuitable. As for the ordering, the data is time-ordered, so the curve necessarily has to be fit in that order.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T15:07:27+00:00Added an answer on June 16, 2026 at 3:07 pm

    You might be looking for polynomial interpolation, in the field of numerical analysis.

    In polynomial interpolation – given a set of points (x,y) – you are trying to find the best polynom that fits these points. One way to do it is using Newton interpolation, which is fairly easy to program.

    The field of numerical analysis and interpolations in specifics is widely studied, and you might be able to get some nice upper bound to the error of the polynom.

    Note however, because you are looking for a polynom that best fits your data, and the function is not really a polynom – the scale of the error when getting far from your initial training set blasts off.


    Also note, your data set is finite, and there are inifnite number (actually, non-enumerable infinity) of functions that can fit the data (exactly or approximately) – so which one out of these is the best might be specific to what you actually are trying to achieve.

    If you are looking for a model to fit your data, note that linear regression and polynomial interpolations are at the opposite ends of the scale: polynomial interpolation might be an overfitting to a model, while a linear regression might be underfitting it, what exactly should be used is case specific and varies from one application to the other.


    Simple polynomial interpolation example:

    Let’s say we have (0,1),(1,2),(3,10) as our data.

    The table1 we get using newton method is:

    0  | 1 |                 |
    1  | 2 | (2-1)/(1-0)=1   |
    3  | 9 | (10-2)/(3-1)=4  | (4-1)/(3-0)=1
    

    Now, the polynom we get is the "diagonal" that ends with the last element:

    1 + 1*(x-0) + 1*(x-0)(x-1) = 1 + x + x^2 - x = x^2 +1 
    

    (and that is a perfect fit indeed to the data we used)


    (1) The table is recursively created: The first 2 columns are the x,y values – and each next column is based on the prior one. It is really easy to implement once you get it, the full explanation is in the wikipedia page for newton interpolation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

there are related questions like smart pointers + "this" considered harmful? but they do
I've look for this, and there's some related questions, but no one gives me
There are some related questions here and here , but they didn't really give
There are some related questions about unpacking single-value tuples, but I'd like to know
Now I know there is some related questions on this topic but this is
I see some related questions have been asked, but they're either too advanced for
Sorry for asking this question, but I searched all Java-related questions, but I got
There are some related questions, but specifically do not answer my question specifically on
There are many questions related to Stackless Python. But none answering this my question,
There is some precedent for search-engine-ranking-related questions on StackOverflow, so please don't close this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.