how can we linearise?

14 次查看(过去 30 天)
Burhan Elaldi
Burhan Elaldi 2019-4-26
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 个)

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by