Path: news.mathworks.com!not-for-mail
From: "Tom Lane" <tlane@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fit power curve with best exponent to data
Date: Wed, 30 Jan 2013 12:09:51 -0500
Organization: MathWorks
Lines: 27
Message-ID: <kebk50$bq1$1@newscl01ah.mathworks.com>
References: <kebg5v$p8c$1@newscl01ah.mathworks.com> <kebj07$79o$1@newscl01ah.mathworks.com>
Reply-To: "Tom Lane" <tlane@mathworks.com>
NNTP-Posting-Host: ah-tlane.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1359565792 12097 172.28.17.232 (30 Jan 2013 17:09:52 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Jan 2013 17:09:52 +0000 (UTC)
In-Reply-To: <kebj07$79o$1@newscl01ah.mathworks.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: news.mathworks.com comp.soft-sys.matlab:787752

>> 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