Minimization problem with integral constraint

6 ビュー (過去 30 日間)
Esteban Garcia
Esteban Garcia 2022 年 5 月 9 日
コメント済み: Esteban Garcia 2022 年 5 月 11 日
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.

採用された回答

Matt J
Matt J 2022 年 5 月 9 日
編集済み: Matt J 2022 年 5 月 9 日
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 件のコメント
Matt J
Matt J 2022 年 5 月 10 日
Maybe fitting log(sigma) will behave better.
Esteban Garcia
Esteban Garcia 2022 年 5 月 11 日
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

サインインしてコメントする。

その他の回答 (1 件)

Mitch Lautigar
Mitch Lautigar 2022 年 5 月 9 日
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.

Community Treasure Hunt

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

Start Hunting!

Translated by