how can we linearise?
14 次查看(过去 30 天)
显示 更早的评论
Linearise the given nonlinear equation and then apply linear least-squares regression to find the equation
for the regression line. Plot the linearised data set together with the regression line. Determine Sr (the sum
of squares of residuals around the regression line) and r2 (the corresponding coefficient of determination).
clc
clear all
close all
syms x y a b A B a0 a1
%given dependent and independent datas
xdata=[0.1 0.2 0.4 0.6 0.9 1.3 1.5 1.7 1.8];
ydata=[0.75 1.25 1.45 1.25 0.85 0.55 0.35 0.28 0.18];
sr=ydata-(a.*xdata.*exp(b.*xdata))
%Finding the values of Sr,St,a,b,r-square
A=diff(sr,a0);
B=diff(sr,a1);
sr=sum(ydata-(a.*xdata.*exp(b.*xdata)))
st=sum((ydata-mean(ydata)).^2);
r2=(st-sr)./st;
display(sr)
display(r2)
display(st)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!