Minimization problem with integral constraint

2 visualizaciones (últimos 30 días)
Esteban Garcia
Esteban Garcia el 9 de Mayo de 2022
Comentada: Esteban Garcia el 11 de Mayo de 2022
Hello, I'm working with a 2D numerical density profile. . I have a set of radius a maximum radius R and I want to find the best fit to the data r. I know that I can use maximum likelihood or another method, but I have problems with the constraints for , because I require that
At first I tried with bins and adjusted the curve with cftool, but I need more precision. So I want to use minimization with that constraint.
Thank you so much.

Respuesta aceptada

Matt J
Matt J el 9 de Mayo de 2022
Editada: Matt J el 9 de Mayo de 2022
Perhaps you could reparametrize the curve as,
which automatically satisfies the constraint for any b and c. Moreoever, since this form has only two unknown parameters, it should be relatively easy to do a parameter sweep to find at least a good initial guess of b and c.
  7 comentarios
Matt J
Matt J el 10 de Mayo de 2022
Maybe fitting log(sigma) will behave better.
Esteban Garcia
Esteban Garcia el 11 de Mayo de 2022
Hello Matt it is much faster now without symbolyc and with log. Thank you
N=length(Rproj);
R=max(Rproj);
A=1000000
B=0
C=0
syms b c
for j=1:N
F(j)=log(2*Rproj(j)*(1+(Rproj(j)/b)^2)^c/(((b^2+R^2)^(c+1)-b^(2*c+2))/(b^(2*c)*(c+1))));
end
E=-sum(F);
fstr=string(E);
fstr=replace(fstr,'b','b(k)');
fstr=replace(fstr,'c','c(j)');
b=0.01:0.001:0.8
c=-1.405:0.001:-0.705
for k=1:length(b)
for j=1:length(c)
n=eval(fstr);
if n<A
A=n;
B=b(k);
C=c(j);
end
end
end

Iniciar sesión para comentar.

Más respuestas (1)

Mitch Lautigar
Mitch Lautigar el 9 de Mayo de 2022
My suggestion is to use a smaller step size for <a,b,c> if you know what they are. Typically when you are trying to fix the curve, the only thing you can do is try to add in more datapoints. If you can provide some code, I can provide more feedback.

Categorías

Más información sobre Solver Outputs and Iterative Display 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