Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: fit power curve with best exponent to data
Replies: 4   Last Post: Feb 1, 2013 2:00 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tom Lane

Posts: 854
Registered: 12/7/04
Re: fit power curve with best exponent to data
Posted: Jan 30, 2013 12:09 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

>> I'm attempting to fit the following equation to a set of data
>> characterizing something's autocorrelation function:
>>
>> y=e^(a*x)^n


Your y seems to drop off exponentially, so you want the exponent to be
negative, and you're raising it to a power that may not be an integer. If I
change your function I can do the following to fit it:

>> myexp = fittype('exp(a*(abs(x-b)^n))')
myexp =
General model:
myexp(a,b,n,x) = exp(a*(abs(x-b)^n))
>> fit(x,y,myexp,'start',[-20,4.47,1])
ans =
General model:
ans(x) = exp(a*(abs(x-b)^n))
Coefficients (with 95% confidence bounds):
a = -103.6 (-115.1, -92.15)
b = 4.475 (4.474, 4.475)
n = 1.065 (1.035, 1.094)

While you may not want this function, I hope this illustrates what you can
try with a function that you choose yourself.

-- Tom




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.