sagar yellapu
unread,Sep 5, 2012, 5:52:07 AM9/5/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello everyone,
I'm facing a problem with fmincon in making it minimize a function.
Please have a look at the problem I have.
minimization:
[d_sigmae,fval(k+1),exitflag]=fmincon('ipca_loglikelihood',d_sigmae0,[],[],[],[],LB,UB,@mycon,opts);
where function 'ipca_loglikelihood' is as follows:
function obj_fun=ipca_loglikelihood(t_diag_elements)
global cA resid
[n1,n2]=size(resid);
N=n2;
t_sigma_e=diag(t_diag_elements);
temp=cA*t_sigma_e*cA';
rsum=0;
for j=1:N
rsum=rsum+resid(:,j)'*((temp)^-1)*resid(:,j);
end
obj_fun=N*log(det(temp)) + rsum;
the 'obj_fun' is getting minimized over 'd_sigmae' of size 5*1. 'cA' is 3*5 matrix,'t_sigma_e' is 5*5 matrix, and an Inverse is computed for the 'temp' which is a composite matrix of the above two. size of 'resid' is 3*1000 and "N*log(det(temp))" is also there in the objective function.
The non-linear constraints are given by the function 'mycon' as follows:
function [c, ceq] = mycon(d_sigma_e)
global cA
sigma_e=diag(d_sigma_e);
ceq=cA*sigma_e*cA'-eye;
c=[];
If the problem is properly minimized, 'd_sigma_e' should turn out to be [0.1;0.08;0.15;0.2;0.18]
for getting this result even though i put bounds as LB=zeros(5,1) or any set of numbers less than the corresponding converged values, UB=1*ones(n,1) or any set of numbers which are just more than the corresponding converged values, the elements of 'd_sigma_e' are not turning out to be close to the solution and most of the elements are just close to either upper or lower bounds.
I am not knowing, what is wrong with the problem. I doubt the ability of fmincon for dealing with this kind of minimization problem, where there is an involvement of many matrices and inverses and logarithmic functions.
Can you suggest any other way of doing this.
I'm much grateful to the people that look into the problem.
awaiting for reply..
Thanks to all in advance.