forked from neurodebian/spm8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspm_LAP_iS.m
More file actions
20 lines (18 loc) · 780 Bytes
/
Copy pathspm_LAP_iS.m
File metadata and controls
20 lines (18 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function [iS] = spm_LAP_iS(p,R)
% default precision function for LAP models (hidden states)
% FORMAT [iS] = spm_LAP_iS(p,R)
%
% p{1} - vector of precisions for causal states (v)
% p{2} - vector of precisions for hidden states (v)
% R - generalised precision matrix
%
% iS - precision matrix for generalised states (causal and then hidden)
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Karl Friston
% $Id: spm_LAP_iS.m 3694 2010-01-22 14:16:51Z karl $
% precisions for generalised errors on causal (V) and hidden states (W)
%==========================================================================
V = kron(R,diag(exp(p.h)));
W = kron(R,diag(exp(p.g)));
iS = blkdiag(V,W);