find intervals for both B and C which make the exponential function F converge to some points.

95 visualizaciones (últimos 30 días)
BURCU
BURCU el 20 de Nov. de 2024 a las 18:50
Comentada: BURCU el 21 de Nov. de 2024 a las 5:59
I have series Y with 258 observations.
I define new series by deleting first and last 50 observations
newY = DlnY(51:end-50);
I also define the series Y lagged 2.
logY = log(Y);
DlnY = diff(logY);
Y2 = [NaN; NaN; DlnY(1:end-2)];
I have exponential function as follows:
F = 1- exp((-B/0.009)*(Y2-C)^2)
F_func = @(B, C, Y2) 1 - exp((-B / 0.009) * (Y2 - C).^2);
The parameter c is in the range of series newY.
C = [min(newY), max(newY)];
The parameter B in the interval from 1 to infinity.
B = [1, Inf];
I) I want to find intervals for both B and C which make the function F converge to 0.
II) I want to find intervals for both B and C which make the function F converge to 0.5.
III) I want to find intervals for both B and C which make the function F converge to 1.
How can I write a MATLAB code find these intervals?
Can you please help me to write these codes. Thank you.
  6 comentarios
BURCU
BURCU el 20 de Nov. de 2024 a las 21:03
Editada: BURCU el 20 de Nov. de 2024 a las 21:04
Yes, you're right. Actually, I wanted it that way, but I couldn't express it properly. How can I calculate this by using MATLAB codes?
Matt J
Matt J el 20 de Nov. de 2024 a las 21:18
Editada: Matt J el 20 de Nov. de 2024 a las 21:18
Actually, I wanted it that way
Which way? Edit your original question to articulate what you really mean.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 20 de Nov. de 2024 a las 21:21
There is no point in calculating most of the F values since we are only interested in convergence. So we only test the last few values. The exact number we test is arbitrary.
F4_func = @(BC) 1 - exp((-BC(1) / 0.009) * (Y2(end-3:end) - BC(2)).^2);
targets = [0, .5, 1];
numtargets = length(targets);
bestBC = cell(numtargets,1);
for Tidx = 1 : numtargets
target = targets(Tidx);
objfun = @(BC) sum((F4_func(BC) - target).^2);
A = []; b = []; Aeq = []; beq = [];
lb = [1 min(newY)];
ub = [inf max(newY)];
nonlfunc = [];
BC0 = [2 mean(newY)];
bestBC{Tidx} = fmincon(objfun, BC0, A, b, Aeq, beq, lb, ub, nonlfunc);
end
  3 comentarios
Walter Roberson
Walter Roberson el 20 de Nov. de 2024 a las 21:41
celldisp(bestBC)
would be more like it.
You could probably instead use
bestBC = zeros(numtargets, 2);
%...
bestBC(Tidx,:) = fmincon(...)
I just wasn't absolutely positive that fmincon() would return vectors of values even in the case where fmincon essentially failed.

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by