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: nlinfit in STATS toolbox
Replies: 1   Last Post: Dec 9, 1996 11:00 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
John Boccio

Posts: 11
Registered: 12/7/04
nlinfit in STATS toolbox
Posted: Dec 9, 1996 9:19 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

Using the m-file below we are trying to fit data to a simple nonlinear
function. See bottom of m-file for function pretrans.m.

The fit is terrible. I have compared the nlinfit result to a result from
Kaleidagraph (see final plot from m-file).

Anyone know what is happening here? Are we using nlinfit wrong?

Thanks,

John Boccio
boccio@swarthmore.edu

% petfit.m
x = [118.9000
119.0000
119.1000
119.2000
119.3000
119.4000
119.6000
119.8000
120.0000
120.2000
120.6000
121.0000
121.4000
121.8000
122.6000
123.4000
124.2000
125.0000];

y = [238.4000
222.9000
208.6000
197.4000
186.3000
176.3000
160.8000
148.8000
136.9000
128.1000
113.3000
102.3000
93.2000
87.5000
76.6000
68.0000
61.3000
55.0000];

beta0=[388,117]';

best=[387.45,117.24]'

[beta,r,j]=nlinfit(x,y,'pretrans',beta0);

plot(x,y,'ro',x,pretrans(beta,x),'y',x,pretrans(best,x),'c')
legend('DATA','NLINFIT','OTHERFIT')

% function yhat=pretrans(beta,x)
% yhat=beta(1)./(x-beta(2));





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.