I need to do nonlinear regression analysis. I have written a code for that and the function is in the form y=a.* log(x + b.*exp(c.*x). The variables a, b, c are unknowns. The matlab code is as follows.
x = load('xval.txt');
y = load('yval.txt');
f = @(b,x) b(1).*(log(x + (b(2).*exp(b(3).*x)))); % Objective Function
B = fminsearch(@(b) norm(y - f(b,x)), [2; -0.1; -5]) % Estimate Parameters
plot(x, y, 'pg')
plot(x, f(B,x), '-r')
I am unable to estimate the above parameters. Could anyone explain how to estimate [2; -0.1; -5]. But I could not fit the curve with the data. The X and Y values are attached. Like this I have 20 sets of xval and yval.
Thanks in advance.