Re: Nonlinear regression 'nlinfit'
- From: "aasim Azooz" <aasimazooz@xxxxxxxxx>
- Date: Thu, 8 May 2008 02:10:06 +0000 (UTC)
"Dan " <dbansal@xxxxxxxxxx> wrote in message
<fvrcbv$des$1@xxxxxxxxxxxxxxxxxx>...
I am having trouble using "nlinfit" function for afitting a
specific type of model to the data set. I would like tofit
a model of the form of:to
y = alfa*x1 + beta*exp(-gamma*x2)
where x1 and x2 are the predictor variables and y is the
response, while alfa, beta and gamma are the coefficients
be determined.the
The help documentation on nlinfit seems to suggest that
function can be used to fit a custom model but I am notable
to understand the syntax of the function calling (for theplease
model).
Has anyone come across a similar problem or has anyone
implemented nlinfit for their custom models? If yes,
send in your suggestions.
Here are the steps you need
Thanks,
db
1- write an M-file to define your function This should look
like
function f=model(a,x1,x2)
f=a(1)*x1+a(2)*exp(-a(3)*x2;
x1 and x2 should either be arrays with equal size or one of
then is a scalar. if they are of different sizes, you
should do a step by step calculation. for example, take all
x1 but one element of x2 or vice versa.
2- save the M-file to work
3- on matlab work space set some starting values for alpha,
beta and gamma by typing
a=[1 1 1] % for example
4- start the fitting by typing
a=nlinfit(x1,y,'model',a)
to see how the fit is
plot(x1,y,'*')
hold
plot(x1,model(a,x1,x2)
if it is OK, change x2 and start again
Aasim Azooz
.
- References:
- Nonlinear regression 'nlinfit'
- From: Dan
- Nonlinear regression 'nlinfit'
- Prev by Date: retain certain pixels in image
- Next by Date: Re: Problem using xlswrite
- Previous by thread: Re: Nonlinear regression 'nlinfit'
- Next by thread: WWW.NICEDVDER.COM FREE SHIPPING,DVD,DVDBOXSET,MOVIE,WHOLESALE,DROPSHIP,DROPSHIPPER,DVDS WHOLESALE,DVD WHOLESALER, DVD CHINA WHOLESALER,CHINA DROPSHIPPER,DVDS DROPSHIPPER,CHINA DVD DROPSHIPPING,CHINA DVD DROPSHIPPER,MOVIE,TV SERIES, TV SHOWS,DVD MOVIES,DVD MOVIE WHOLESALE,DVD MOVIE DROPSHIP,DVD MOVIE WHOLESALER,PLANET EARTH $ 9.99, The BLUE PLANET $ 9.99, CSI SEASONS1-7 $ 49.99,ALLY MCBEAL SEASONS1-5 $ 39.99,THE GODFATHER $ 9.99 ,XENA SEASONS1-6 $ 54.99,DISNEY 132MOVIES $ 94.99,BABY EINSTEIN 25DISCS $ 29.99,SCRUBS SEASONS1-6 $ 24.99,SEX AND THE CITY DVD9 SEASONS1-6 $ 29.99,007 JAMES BOND $ 24.99, HEROES $14.99,CHARMED $ 55.99,SOPRANOS $ 25.99,STAR TREK $ 44.99 and SO MANY MOVIES FREE SHIPPING WWW.NICEDVDER.COM
- Index(es):
Relevant Pages
|
Loading