Skip to main content
3 of 3
edited title
C. E.
  • 71.2k
  • 6
  • 141
  • 269

How to fit different parts of a log-log plot

I have data of a function that goes like $f(x)\propto x ^\alpha $ for a certain range of $x$ and like $f(x)\propto x^\beta$ for another one. It is common in the literature to make a log log plot and then fit two straight lines in the corresponding regimes to show the different exponents. I was wondering how one can achieve this in Mathematica. Basically, the questions are

  1. How to make a linear fit on loglog data?

  2. How to make and show multiple linear fits on different ranges of the data?

Answering to a comment that asked for more information: I don't have an analytical result for the crossover value $x_c$ at which the function changes regimes. Evenmore, it's not an inmediate change but there's a intermediate regime for values of $x$ close to the crossover where the function is not $f(x)\propto x ^\alpha $ or $f(x)\propto x^\beta$. Here I show a plot of the data in loglog scale.

enter image description here

The first regime is between 5 and 100 and the second one is in the last part of the data.