Home > brede > brede_mat_sem_loglikelihood.m

brede_mat_sem_loglikelihood

PURPOSE ^

brede_mat_sem_loglikelihood - Log-likelihood for structural equation

SYNOPSIS ^

function ll = brede_mat_sem_loglikelihood(M, K, Psi)

DESCRIPTION ^

 brede_mat_sem_loglikelihood - Log-likelihood for structural equation 

       ll = brede_mat_sem_loglikelihood(M, K, Psi)

       Input:  M   'Mat' structure with data matrix
               K   'Mat' structure with structure matrix
               Psi 'Mat' structure with diagonal noise

       Logarithm of likelihood in the structural equation model. 

       If the Psi input argument is not given then it is computed
       within the function. 

       Example: 
         Ktrue = [ 0 1 -0.3 ; 0 0 0 ; 0 0 0 ];
         X = randn(100,3)*pinv(eye(3)-Ktrue); 
         x = -1:0.2:2; y = -2:0.2:2; clear ll
         for n=1:length(x),for m=1:length(y),
           K=zeros(3); K(1,2)=x(n); K(1,3)=y(m);
           ll(m,n) = brede_mat_sem_loglikelihood(X, K);
         end, end
         figure, surf(x,y,ll), hold on, plot3(1,-0.3, max(ll(:)), 's')

       See also BREDE, BREDE_MAT, BREDE_MAT_SEM, BREDE_MAT_SEM_GROW.

 $Id: brede_mat_sem_loglikelihood.m,v 1.2 2007/01/09 22:14:21 fn Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 27-Nov-2009 18:11:22 by m2html © 2005