forked from OpenHUTB/spm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspm_LAP_ph.m
More file actions
28 lines (25 loc) · 742 Bytes
/
Copy pathspm_LAP_ph.m
File metadata and controls
28 lines (25 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function p = spm_LAP_ph(x,v,h,M);
% default precision function for LAP models (causal states)
% FORMAT p = spm_LAP_ph(x,v,h,M);
%
% x - hidden states
% v - causal states
% h - precision parameters
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Karl Friston
% $Id: spm_LAP_ph.m 3694 2010-01-22 14:16:51Z karl $
% fixed components
%--------------------------------------------------------------------------
p = sparse(M.l,1);
try
V = diag(M.V);
if all(V)
p = log(V);
end
end
% free components
%--------------------------------------------------------------------------
for i = 1:length(M.Q)
p = p + h(i)*diag(M.Q{i});
end