function [L,G] = log_like(B2,B1,X,Y)
%Función Calcula Log Likelihood (-LL) para usar con fminsearch


B=[B1 B2];

N=size(Y,1);
K=size(B,2);


y=valores(Y,K);

P=prob_multi(X,B);
L=0;
for i=1:N
    for j=1:K
    
     L=  y(i,j)*log(P(i,j))+L;
        
    end
end

L=-L;

g=grad(X,Y,B1,B2,K);

G=g(:,2:3);

end

