10-5 ��������������������������������?

~Aڭ̥iQܧΪk]Transformation^AN@ƾǼҫഫu]tuʰѼƪҫCҦpA]@ҫG $$ y=ae^{bx} $$

۵MơAio

$$ \ln y = \ln a + bx $$

ɡA$\ln a$ $b$ ܦuʰѼơAڭ̥iΡ̤pkXȡAШUCϥܧΪkdҡG

Example 1: 10-uXPjkR/transformFit01.mload data2.txt x = data2(:, 1); % wI x y y = data2(:, 2); % wI y y A = [ones(size(x)) x]; theta = A\log(y); subplot(2,1,1) plot(x, log(y), 'o', x, A*theta); xlabel('x'); ylabel('ln(y)'); title('ln(y) vs. x'); legend('Actual value', 'Predicted value'); a = exp(theta(1)) % ѱo줧Ѽ b = theta(2) % ѱo줧Ѽ y2 = a*exp(b*x); subplot(2,1,2); plot(x, y, 'o', x, y2); xlabel('x'); ylabel('y'); legend('Actual value', 'Predicted value'); title('y vs. x'); fprintf('~tM = %d\n', sum((y-y2).^2)); a = 4.3282 b = -1.8235 ~tM = 8.744185e-01

bWzϧΤAĤ@ӤpϬO $\ln y$ $x$ @ϡAӲĤGӤphO $y$ $x$ @ϡCЯSO`NAgܧΪkA̤pkұo쪺̤p`~tO $$ E'=\sum_{i=1}^m (\ln y_i - \ln a - bx_i)^2 $$

ӤOҫ`~tG $$ E=\sum_{i=1}^m (y_i - ae^{bx_i})^2 $$

q` $E'$ ̤pȮɡA$E$ @wO̤pȡAq`̤pȥ礣oIYnqDAiA fminsearch D $E$ ̤pȡAåH]ܧΫ^̤pko쪺 a b jM_IAШUCdҡG

Example 2: 10-uXPjkR/transformFit02.mload data2.txt x = data2(:, 1); % wI x y y = data2(:, 2); % wI y y A = [ones(size(x)) x]; theta = A\log(y); a = exp(theta(1)) % ѱo줧Ѽ b = theta(2) % ѱo줧Ѽ theta0 = [a, b]; % fminsearch ҩlѼ theta = fminsearch(@(x)errorMeasure3(x, data2), theta0); x = data2(:, 1); y = data2(:, 2); y2 = theta(1)*exp(theta(2)*x); plot(x, y, 'o', x, y2); xlabel('x'); ylabel('y'); legend('Actual value', 'Predicted value'); title('y vs. x'); fprintf('~tM = %d\n', sum((y-y2).^2)); a = 4.3282 b = -1.8235 ~tM = 1.680455e-01

ѤWzdҥiHݥXAڭ̥iHϥܧΪkAXjѼƭȡAMA fminsearch ӹ~tMi̤pơA]o쪺~tMA|e@ӽdҡ]uܧΪk^٭npC]MAboӽdҤAڭ̩wqF@ӥQ̤pƪ~t`M禡 errorMeasure3.mA`ٽgTA䤺eACXAŪ̽ЦۦѦҥФɮסC^

ƹWAܦhݰ_ӬODuʪjkҫAgLF@ഫAN|ܦuʪjkҫA]NiHϥΧڭ̳o@`һܧΪkAӶiuʰjkѼƨDCHUO@ܧΪkiΪDuʼҫAHάഫkG

s Duʼҫ ഫ᪺uʼҫ Ѽഫ
1 $y=\frac{ax}{1+bx}$ $\underbrace{\frac{1}{y}}_Y=\underbrace{\frac{1}{a}}_\alpha \frac{1}{x}+\underbrace{\frac{b}{a}}_\beta$ $a=\frac{1}{\alpha}$, $b=\frac{\beta}{\alpha}$
2 $y=\frac{a}{x+b}$ $\underbrace{\frac{1}{y}}_Y=\underbrace{\frac{1}{a}}_\alpha x+\underbrace{\frac{b}{a}}_\beta$ $a=\frac{1}{\alpha}$, $b=\frac{\beta}{\alpha}$
3 $y=\frac{ax}{x^2+b^2}$ $\underbrace{\frac{1}{y}}_Y=\underbrace{\frac{1}{a}}_\alpha x+\underbrace{\frac{b^2}{a}}_\beta \frac{1}{x}$ $a=\frac{1}{\alpha}$, $b=\pm\sqrt{\frac{\beta}{\alpha}}$
4 $y=ax^b$ $\underbrace{\ln y}_Y = \underbrace{b}_\alpha \ln x + \underbrace{\ln a}_\beta$ $a=e^\beta, b=\alpha$
5 $y=\frac{1}{1+ax^b}$ $\underbrace{\ln \frac{1-y}{y}}_Y = \underbrace{b}_\alpha \ln x + \underbrace{\ln a}_\beta$ $a=e^\beta, b=\alpha$
6 $y=\frac{1}{1+exp\left(\frac{ax}{b+x}\right)}$ $\underbrace{\left[\ln \frac{1-y}{y}\right]^{-1}}_Y=\underbrace{\frac{b}{a}}_\alpha \frac{1}{x}+\underbrace{\frac{1}{a}}_\beta$ $a=\frac{1}{\beta}, b=\frac{\alpha}{\beta}$
7 $y=\ln a + x - \ln (e^x+b)$ $\underbrace{e^{-y}}_Y=\underbrace{\frac{b}{a}}_\alpha e^x+\underbrace{\frac{1}{a}}_\beta$ $a=\frac{1}{\beta}, b=\frac{\alpha}{\beta}$
8 $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$ $\underbrace{y^2}_Y=\underbrace{-\frac{b^2}{a^2}}_\alpha x^2+\underbrace{b^2}_\beta$ $a^2=-\frac{\beta}{\alpha}, b^2=\beta$
9 $(x-a)^2+(y-b)^2=c^2$ $\underbrace{x^2+y^2}_Y=\underbrace{2a}_\alpha x+\underbrace{2b}_\beta y+\underbrace{c^2-a^2-b^2}_\gamma$ $a=\alpha/2, b=\beta/2\\c=\gamma+\frac{\alpha^2}{4}+\frac{\beta^2}{4}$
10 $y=a e^{\left[-\left(\frac{x-c}{b}\right)^2\right]}$ $\underbrace{\ln y}_Y = \underbrace{-\frac{1}{b^2}}_\alpha x^2+ \underbrace{\frac{2c}{b^2}}_\beta x+\underbrace{\ln a-\frac{c^2}{b^2}}_\gamma$ $a=exp \left( \gamma - \frac{\beta^2}{4}\right)\\b=\pm \sqrt{-\frac{1}{\alpha}}\\c=-\frac{\beta}{2\alpha}$
11 $y=\frac{a}{\sqrt{(1+bx^2)^2+c}}$ $\underbrace{\frac{1}{y^2}}_Y=\underbrace{\frac{b^2}{a^2}}_\alpha x^4+\underbrace{\frac{2b}{a^2}}_\beta x^2+\underbrace{\frac{c+1}{a^2}}_\gamma$ $a=\pm\frac{\sqrt{4\alpha}}{\beta}\\b=\frac{2\alpha}{\beta}\\c=\frac{4\alpha\gamma}{\beta^2}-1$

MATLAB{]pGig