How Do I Fitting a 3 Unknown Parameter Model?
Show older comments
I am trying to fit the Vogel-Fulcher-Tammann equation to a set of data taken. The equation has 3 unknown parameters that I would like to find out. The eqaution I am trying to fit is as follows:
n = Aexp(b/(t-T))
t and n are known. But how would I go about fitting this model to find A,b, and T?
Cheers,
Jordan
Accepted Answer
More Answers (1)
Mathieu NOE
on 15 Jan 2021
hello Jordan
see example below
x = 0:100;
N = length(x);
tau = 10; % time scale of relaxation
x_asym = 4; % relative increase of the observable x t -> infinity
y = x_asym*(1 - exp(-x/tau)); % uncorrupted sought-for signal
sig = 0.25; % noise strength
% Use AR(1) to corrupt the signal instead of white noise.
phi = 0.6; % AR coefficeint
xi1 = sig*randn(1,N);
pert1 = filter(1,[1 -phi],xi1);
y_noisy = y+pert1;
% exponential fit method
% code is giving good results with template equation : % y = a.*(1-exp(b.*(x-c)));
f = @(a,b,c,x) a.*(1-exp(b.*(x-c)));
obj_fun = @(params) norm(f(params(1), params(2), params(3),x)-y_noisy);
sol = fminsearch(obj_fun, [y_noisy(end),0,0]);
a_sol = sol(1);
b_sol = sol(2);
c_sol = sol(3);
y_fit = f(a_sol, b_sol,c_sol, x);
figure
plot(x,y,'-+b',x,y_noisy,'r',x,y_fit,'-ok');
legend('signal','signal+noise','exp fit');
Categories
Find more on Linear Model Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!