f



Best fit line for an exponential line

Hi, 
 I am new to using GNUPLOT and am trying to find the best fit line (to
determine the slope) of a line that follows Power Law (is an
exponential line).  I realize I have to use a function f(x) = a*b**x.
But, I do not know what to do next. Any help in this matter would be
greatly appreciated.

Thanks,
Divya
0
divyarao09
5/4/2004 4:53:35 PM
comp.graphics.apps.gnuplot 5008 articles. 0 followers. Post Follow

2 Replies
756 Views

Similar Articles

[PageSpeed] 55

Divya Rao <divyarao09@yahoo.com> wrote:
> Hi, 
>  I am new to using GNUPLOT and am trying to find the best fit line (to
> determine the slope) of a line that follows Power Law (is an
> exponential line).  

First, a terminology issue: an exponential curve doesn't have a
"slope" to speak of.  More precisely, the slope is different at every
place, so it's not a property of the curve as such, but of each point
on the curve.

> I realize I have to use a function f(x) = a*b**x.

That's one way of expressing it. f(x)=a*exp(x/k) or
f(x)=exp(b1*(x-x0)) and any variations of those may be just as valid
choices.

> But, I do not know what to do next. Any help in this matter would be
> greatly appreciated.

Read through "help fit" and you should be on your way.

-- 
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
0
Hans
5/4/2004 5:14:56 PM
On Tuesday 04 May 2004 12:53, Divya Rao (divyarao09@yahoo.com)  held forth
in comp.graphics.apps.gnuplot
(<69dbc103.0405040853.25260afb@posting.google.com>):

> Hi,
>  I am new to using GNUPLOT and am trying to find the best fit line (to
> determine the slope) of a line that follows Power Law (is an

The slope of an exponential is not a straight line. However, if you intend
to find a tangent to an exponential function, which you would calculate
*after* finding a best fit, that can be done.

> exponential line).  I realize I have to use a function f(x) = a*b**x.
> But, I do not know what to do next. Any help in this matter would be
> greatly appreciated.

Next step :

fit {xrange} {yrange} f(x) "<your filename>" {using ...} via a,b

For instance :

Say expdata.dat is your datafile and your data is plotted in the 5th column
vs the 1st one. And you want to restrict the fit to x \in [-1,1],

fit [-1:1] f(x) "expdata.dat" u 1:5 via a,b

HTH

gnuplot> help fit

should help further. Look particularly into defining initial values of
FIT_LIMIT, a and b (your fit function is going to be very sensitive to the
value of b).
0
Madhusudan
5/5/2004 3:34:07 AM
Reply:

Similar Artilces:

Line of best fit
I am new to python so apologies for the ignorance with this question. How would I apply a line of best fit to a plot? My data are netCDF4 data files and this is essentially what I have done so far: swh1=netCDF4.Dataset('filename','r') hs1=swh1.variables['hs'] swh2=netCDF4.Dataset('filename'.'r') hs2=swh2.variables['hs'] plt.plot(hs1,hs2,'.') Cheers, Jamie --001a113a6020e6901104f5e5a9f1 Content-Type: text/plain; charset=UTF-8 None of these are in the standard library but why re-invent the wheel? Using numpy:...

Best Fit Line
Hello, I have a problem that is puzzling me for very long.I got this problem of fitting in 80 over text files and within each txt file,it contains about 120 datas.I want to from these datas generate a best fit line to cut through all these points.The program I am now using is Matlab.Please help and reply asap,as I need the info urgently. Thanks. In article <a488ubsdofj7@legacy>, kellyblue19@yahoo.com (Eid) writes: >Hello, > I have a problem that is puzzling me for very long.I got this >problem of fitting in 80 over text files and within each t...

Line of best fit
I'm a total newbie at this guys. I have the following data in an .m file: x = 0:2:20; y = [0.02 0.26 0.35 0.53 0.66 0.78 0.88 0.96 1.03 1.06 1.14]; plot(x,y,'rx'); How would i fit a line of best fit to this graph? I know this is rudimentary stuff but as i said i'm a total newbie!!! Cheers for any help help polyfit /Johan Jamie Sutton wrote: > I'm a total newbie at this guys. > I have the following data in an .m file: > > x = 0:2:20; > y = [0.02 0.26 0.35 0.53 0.66 0.78 0.88 0.96 1.03 1.06 1.14]; > plot(x,y,'rx'); > > How would i fit...

Best fit line?
Hi. Is there a function to calculate/plot the best fit line given a few (approx 3) points? I don't have any toolboxes, nor can I afford any. Can any function in the basic matlab application do this? Thanks! "Amir " <amirschricker.DELETE@DELETE.gmail.DELETE.com> wrote in message <g4o8va$aa7$1@fred.mathworks.com>... > Hi. Is there a function to calculate/plot the best fit line > given a few (approx 3) points? I don't have any toolboxes, > nor can I afford any. > > Can any function in the basic matlab application do this? Yes. help polyfit J...

Midpoint of a line, Thirdpoint of line, Quarterpoint of line
Dear Matlab community, For some reason I am having difficulty formulating the points that divide a line segment into thirds and fourths. The midpoint is easy, just the (mean([x1,x2]),mean([y1,y2])), but for some reason my mind is blanking on the others. Please help point me in the right direction. I will do the rest. Thanks in advance. Eric Nevermind...figured it out. sorry to bother, I was just having a lapse in my thinking. ...

Display a file line by line but not blank lines.
Sorry I just can't work how not to display balnk lines with in a file to the web, especially at the end of the file. $contents = fopen("$file",'rb'); if (!$contents) { echo '<strong>Please Try Again Later.</strong><br />'; exit; } $counter = 0; while (!feof($contents)) { $counter = $counter + 1; $line = fgets($contents, 999); echo $counter.'. '; echo $line.'<br /><br />'; } Rob B wrote: > Sorry I just can't work how not to display balnk lines with in a file > to th...

command line for R2 of fit line and data
I just got the curvefit toolbox; in the gui you can get an R2 value for the fit line compared to your actual data. How do you do that with a command line? I can get the curve (fit(x,y,fittype)), smooth the data, plot it, etc etc, but can't seem to get anything more than the Correlation Coefficient of the raw or smoothed data (corrcoef(x,y) which appears to be the correlation for a linear fit. I want to be able to see the R2 value no matter the fittype. Thanks for any advice. Augustus ...

best fit line of an ROI
Hi everyone., The following code reads an image, allows user to select an ROI and then the intention is to select 1000 points randomly in the ROI and generate a best fit line through these points. By inserting breakpoints i see that the points generated randomly lie in the range of points belonging to the ROI. So, it seems there is no problem at this stage.I am not able to identify where else there is an error. Pls help. Thanx in advance. clc; close all; clear all; %WHEN USING THE IMAGE MAKE SURE THAT BW AND BW1 DO NOY HAVE TOO MANY ELEMENTS, IF THEY DO CROP BW AND BWI AND USE THE CROPPED...

cumul line by line
Hi, I would like something simple to execute one query for what I want. In fact, I would like a sql output in this way : name cpt cumul n2 12 22 n1 10 10 n3 5 27 How can I do that in one mysql query ? PS : the cpt is already a sum() calculation because I want the sum of This is a table example : name price n1 5 n1 5 n2 7 n2 5 n3 1 n3 2 n3 3 My current request is : SELECT DISTINCT(name) AS name, SUM(price) AS cpt FROM table GROUP BY name ORDER BY cpt DESC Thanks for helping me. :-) Sorry, I swapped two line just before posting here... Le samedi 16 f=E9vrier 2008 =E0 16:35 +0100, News...

How to read a text file line by line and remove some line
Can anyone please help me in writing the code in C++ : I want a read a file line by line,remove the lines which have length of a particular field in a line exceeding 63 characters After removing the line the corresponding blank spaces generated after removal of the line also needs to be removed. .. I am in urgent need for this solution.Kindly help how to go about it. Thanks in advance , Kaushik "kaushikshome" writes: > Can anyone please help me in writing the code in C++ : > > I want a read a file line by line,remove the lines which have length of > a particular ...

nonlinear best-fit line
Good afternoon, I am having trouble trying to figure out how to fit a nonlinear best fit line to my data in SAS. Any help would be greatly appreciated. Regards, Ligia ...

best fit line through coordinates
Hi guys, I have an issue I'd like some help with. coordinates = 107.35 107 111.51 146 117 154.61 111.29 114 In the above matrix 'coordinates', its actually in the form [ x1 y1 x2 y2] for each of the 2 rows. Is there any function I can obtain a best fit line using these 4 points? thanks Kurtis Go look up the demo on the function polyfit, u can tell it to make a first order regression of those...

Outputting lines of best fit
I have a set of data in an array (11000,207). I've been asked to detrend the data in each of the 207 columns individually. I've tried using the Matlab detrend but I cant get it to work in a sensible way for this data. Instead I've been trying to ouput the equation for a line of best fit for the data in each column and then subtract that from the data. Seems a simple task but the only way I have found to find a line of best fit is doing it manually once you have a figure up using the best fitting option in tools. Obviously I don't want to do this manually 207 times. Does any...

Cabling line in from line out
Can I run a cable from my line out port on my iMac 17" to my line in port? That way I can use sound recorder to record DVD audio. Or will this somehow give me catastrophic consequences? Matt Revenaugh Matt Revenaugh: > Can I run a cable from my line out port on my iMac 17" to my line in port? > That way I can use sound recorder to record DVD audio. Or will this somehow > give me catastrophic consequences? ***** Perhaps -- if you want to do it the 19th Century way. The 21st Century way is described at <http://www.rogueamoeba.com/audiohijackpro/>. Davoud -- usen...

Weighted Line of Best Fit
At the moment I am writing code to find the weighted line of best fit. I can calculate the line of best fit using the code given below, where sortWLAN corresponds to the entries in an array, which I want to extract. onedist = sortWLAN(3,1:100); onerssi = sortWLAN(4,1:100); onewgt = sortWLAN(5,1:100); coeffs = polyfit(onedist,onerssi, coefficient); curvefit = polyval(coeffs, distance); hold on plot(onedist, onerssi, 'o'); plot(distance,curvefit, 'r'); hold off Anybode have any ideas? Cheers Brad wrote: > At the moment I am writing code to find the weighted line of best &...

Best fit line in subplot
I want to add a linear trendline in both the plots of subplot. How do i do this, when i do this using the basic fitting option from the tools menu of figure, the line appears only for one data set ata time, i want to do it for both the data sets. You're right, it doesn't seem possible to do it with the Basic Fitting tool. I guess you have to do it by hand, like this: %%%%% x=[0:0.005:1.5]; %curve 1 y=sin(x); %linear fit 1 p = polyfit(x,y,1) y_lin = polyval(p,x); %curve 2 z=cos(x); %linear fit 2 p = polyfit(x,z,1) z_lin = polyval(p,x); %plot subplot(1,2,1) h(1)=plot(x,y) hold on h(2)=...

line of best fit #2
I have two vectors and plotted them using a stem graph. I want to find the line of best fit and display this on the graph. I know about the function polyfit, but how do I graph its output? Look at help polyval cheers Peter wrote: > > > I have two vectors and plotted them using a stem graph. I want to > find the line of best fit and display this on the graph. I know > about > the function polyfit, but how do I graph its output? ...

Line of best fit #3
I have a matrix simular to the one below: 1 2 2 3 3 4 4 5 5 6 6 7 7 8 Is there a command that will give me an equation for a line of best fit for these data points? Thanks On Sep 27, 4:16=A0pm, "Charles " <charles.vaug...@colorado.edu> wrote: > I have a matrix simular to the one below: > > =A0 =A0 =A01 =A0 =A0 2 > =A0 =A0 =A02 =A0 =A0 3 > =A0 =A0 =A03 =A0 =A0 4 > =A0 =A0 =A04 =A0 =A0 5 > =A0 =A0 =A05 =A0 =A0 6 > =A0 =A0 =A06 =A0 =A0 7 > =A0 =A0 =A07 =A0 =A0 8 > > Is there a comm...

line by line subtraction
Hello I'm looking for a quiker way to do this: 1 1 1 - 1 2 3 = 0 -1 -2 2 2 2 1 0 -1 i.e. to subtract one vector from every line of a matrix (which do have the same number of columns) right now i'm doing it like this for ii = 1:number_of_lines a(ii,:) = b(ii,:) - c; end is there any faster way of doing this (as i have quite a lot of subtractions to do...)? thank you very much thethos Hi, you could try subtracting the matrix c=repmat([1,2,3],number_of_lines,1) from the matrix containing the lines 111, 222, ... the repmat com...

map command line start of line and end of line
Is there a way to remap the key strokes used for going to the begining or end of a commandline. In other words can I change Ctrl-E with Ctrl-end? this might seem like a silly request but due to a problem/ configuration with my fingers the ctrl-e command is very difficult. I know that keys can be mapped to commands but I haven't a clue if there is a way to specify the start of a command line using "job/ define ...." thank for the help john john coltrane wrote: > Is there a way to remap the key strokes used for going to the begining > or end of a commandline. > In oth...

Trim a line by line
Is it possible to trim a line with another line using Corel Draw 10? I don't have 10 but it works in 9 and 11, so I presume it does in 10. Craig "Ciprian" <citronelu@yahoo.com> wrote in message news:556b085e.0309100115.62396430@posting.google.com... > Is it possible to trim a line with another line using Corel Draw 10? ...

Best fit line for sinusoid
Hi all, I was wondering if there was a 'simple' way to get IDL to plot a best fit l= ine for a sinusoidally-varying data set. For example, say temperatures were= recorded each hour for 5 days at a certain location, with each measurement= having an error of 2 deg C. Then we would have something like: day =3D findgen(121)/24 temp =3D 15 + 10*sin(10*!pi*findgen(121)/120) + 5*randomu(seed, 121) error =3D fltarr(121)+2 Is it possible from these three arrays for IDL to work out and plot a best = fit line? I have searched online, and can't really find what I'm looking...

Some lines before and after the line with the pattern
Hello dear newsgroup participants, I would like to know how to accomplish following in awk: find some line with the pattern in one of the columns (this is obvious) AND print not only this line but also variable amount of lines before and/or after the line with the pattern. Background: On occasion one need to look not only on the value but also on how quicly did it come to this value for example (first derivative so to say :)). Is it possible to do it with awk and if yes -- how? With Best Regards Ariel Burbaickij Ariel.Burbaickij@web.de wrote: > Hello dear newsgroup participants, >...

Help With Best Fit Lines
Hello All: I am trying to compare an observed dataset with best-fit models for: 1) Power Law 2) Exponential 3) Exponential Truncated Power Law I am able to get these four datasets (observed data + 3 models). But now I wish to see which of the models fits the dataset the best. It seems MATLAB AIC will only fit your data to built-in models, and not these 3 models I approximated myself. Any suggestions for procedures (whether or not they use MATLAB or AIC) will be very helpful!! Thank you. Jo PS: The datasets are not the same size (i.e. observed x=50 points, y=50 points. models x=1030 poi...

Web resources about - Best fit line for an exponential line - comp.graphics.apps.gnuplot

Exponential hierarchy - Wikipedia, the free encyclopedia
... An equivalent definition is that a language L is in if and only if it can be written in the form ^ Sarah Mocas, Separating classes in the exponential-time ...

Opportunities For Women In the Exponential Era: Vivek Wadhwa at TEDxBayArea Ignite - YouTube
Vivek Wadhwa is Vice President of Academics and Innovation at Singularity University; Fellow, Arthur & Toni Rembe Rock Center for Corporate Governance, ...

SocietyOne hires architect of Lending Club's exponential P2P growth
... lender is about to ramp up for an attack on banks' highly-profitable personal lending books, SocietyOne has hired the architect of the exponential ...

Exponential Changes in Forecasting - AccuWeather.com
Meteorologists have gone from forecasting three days of weather to forecasting 25. New technology makes that possible.

Exponential algorithm making Windows XP miserable could be fixed
Tom Carden Windows XP is really old, and we would suggest that you don't use it unless you really have no option. For the most part, however, ...

The Exponential View
... of writing something, I am going to promote something. My partner Albert turned me onto Azeem Azhar ‘s weekly newsletter called The Exponential ...

Exponential complexity
This entry was posted on Tuesday, March 23rd, 2010 at 12:36 am and is filed under Burkean bells , Good News For Conservatives . You can follow ...

Cisco: In the Market for Finisar? Mobile Forecast Shows Exponential Growth through 2018
Shares of Cisco Systems (CSCO) are up 3 cents at $21.82, as a rumor apparently makes the round the company is considering buying fiber optics ...

Exponentials, Currying, and Universal Constructions
Haskell is a language deeply rooted in category theory. But as you don’t need to study the root system of Vitis vinifera in order to enjoy a ...

TrackingPoint Announces Exponential Growth For 2014
TrackingPoint Announces Exponential Growth For 2014 Company Restructures To Streamline Operations and Accelerate Growth PR Newswire PFLUGERVILLE, ...

Resources last updated: 3/3/2016 1:43:14 AM