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 460153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:50:41+00:00 2026-05-12T22:50:41+00:00

I would like to do an algebraic curve fit of 2D data points, but

  • 0

I would like to do an algebraic curve fit of 2D data points, but for various reasons – it isn’t really possible to have much of the sample data in memory at once, and iterating through all of it is an expensive process.

(The reason for this is that actually I need to fit thousands of curves simultaneously based on gigabytes of data which I’m reading off disk, and which is therefore sloooooow).

Note that the number of polynomial coefficients will be limited (perhaps 5-10), so an exact fit will be extremely unlikely, but this is ok as I’m trying to find an underlying pattern in data with a lot of random noise.
I understand how one can use a genetic algorithm to fit a curve to a dataset, but this requires many passes through the sample data, and thus isn’t practical for my application.

Is there a way to fit a curve with a single pass of the data, where the state that must be maintained from sample to sample is minimal?

I should add that the nature of the data is that the points may lie anywhere on the X axis between 0.0 and 1.0, but the Y values will always be either 1.0 or 0.0.

So, in Java, I’m looking for a class with the following interface:

public interface CurveFit {
   public void addData(double x, double y);
   public List<Double> getBestFit(); // Returns the polynomial coefficients
}

The class that implements this must not need to keep much data in its instance fields, no more than a kilobyte even for millions of data points. This means that you can’t just store the data as you get it to do multiple passes through it later.

edit: Some have suggested that finding an optimal curve in a single pass may be impossible, however an optimal fit is not required, just as close as we can get it in a single pass.

The bare bones of an approach might be if we have a way to start with a curve, and then a way to modify it to get it slightly closer to new data points as they come in – effectively a form of gradient descent. It is hoped that with sufficient data (and the data will be plentiful), we get a pretty good curve. Perhaps this inspires someone to a solution.

  • 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-05-12T22:50:41+00:00Added an answer on May 12, 2026 at 10:50 pm

    I believe I found the answer to my own question based on a modified version of this code. For those interested, my Java code is here.

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

Sidebar

Related Questions

Correct me if I'm wrong, but it seems like algebraic data types in Haskell
Would like to know is that possible to have filter with default value with
I am learning about Algebraic DTs in haskell. What I would like to do
Would like to do this: letters: charset ABCDEFGHIJKLMNOPQRSTUVWXYZ pick letters 2 but pick doesn't
I have developed a program in Octave to which I would like to add
I have the following algebraic data types: data Exp = Con Int | Var
I'm creating a library to allow OCaml/Haskell-like algebraic data types and pattern matching. The
I would like to map a thread_id. This in C/CUDA but it is more
I have a number of small algorithms that I would like to write up
I would like to hear from you folks that have achieved a high-level of

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.