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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:15:36+00:00 2026-05-25T03:15:36+00:00

I have a set of data points and am curious if the data represents

  • 0

I have a set of data points and am curious if the data represents a linear function or a logarithmic function.

The data set is 2 dimensional.

Let’s say an ideal set of data points followed the function f(x) = x. If I plotted the data point I would be able to tell it is linear.

Similarly if the data points followed the function f(x) = log(x), I would be able to visually tell it is logarithmic.

On the other hand, having the program determine if a set of data is linear or logarithmic is nontrivial. How would I approach this?

  • 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-25T03:15:37+00:00Added an answer on May 25, 2026 at 3:15 am

    One option would be to do a linear regression on the data set to get a best-fit line. If the data is linear, you’ll get a very good fit and the mean squared error should be low. Otherwise, you’ll get an okay fit and a reasonable error.

    Alternatively, you could consider transforming the data set by converting each point (x0, x1, …, xn, y) to (x0, x1, …, xn, ey). If the data was linear, now it will be exponential, and if the data was logarithmic, now it will be linear. Running a linear regression and getting the mean-squared error now will have a low error for the logarithmic data and a staggeringly huge error for the linear data, since the exponential function blows up extremely quickly.

    To actually implement the regression, one option would be to use a least-squares regression. This would have the added benefit of giving you a correlation coefficient in addition to the model, which could also be used to distinguish between the two data sets.

    Because you’ve asked for how to do this in Java, a quick Google search turned up this Java code to do a linear regression. However, you might have a better fit in a language like Matlab that is specifically optimized to do these sorts of queries. For example, in Matlab, you can do this regression in one line of code by writing

    linearFunction = inputs / outputs
    

    Hope this helps!

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

Sidebar

Related Questions

I have a txt file which contains a set of 3 Dimensional data points
I have a set of data points in 3D space which apparently all fall
I have a set of X,Y data points (about 10k) that are easy to
I have a data set with over 50,000 geocoded points (lat-long). Each point has
I have a set of data points (which I can thin out) that I
Say I have an object called data which contains a variety of information. Let's
I have a large set of data to be plotted on google map. Because
We have this set of data that we need to get the average of
I have a set of data that models a hierarchy of categories. A root
I have a set of data protected by 16bit checksums that I need to

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.