Fmincon - error using barrier
Mostra commenti meno recenti
Hi all.
I would like get pmf's optimul value in entopy
I started simple test.
I changed pmf to pdf.
but it have some problem.
please, anyone help me?
clc;
clear all;
func = @(k)int_fun(k);
x0 = [0];
A = [];
b = [];
Aeq = [];
beq = [];
lb = [0];
ub = [1];
Q = fmincon(func,x0,A,b,Aeq,beq,lb,ub)
function [ F ] = int_fun(k)
fun = @(x) (-(k*dirac(x-1) + (1-k)*dirac(x+1)).*log(1./(k*dirac(x-1) + (1-k)*dirac(x+1))));
F=integral(fun,-inf,inf);
end
1 Commento
Ameer Hamza
il 21 Apr 2020
dirac() function gives infinity when its input is 1. It can cause issues in the function fun, making it impossible to integrate
fun = @(x) (-(k*dirac(x-1) + (1-k)*dirac(x+1)).*log(1./(k*dirac(x-1) + (1-k)*dirac(x+1))));
Can you show us the actual problem ad whar are you trying to optimize?
Risposte (0)
Categorie
Scopri di più su Nonlinear Optimization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!