Home > vbmeg > functions > estimation > bayes > vb_set_vb_prior.m

vb_set_vb_prior

PURPOSE ^

Return prior hyper-parameter using fMRI activity pattern.

SYNOPSIS ^

function [a0,Ta0] = vb_set_vb_prior(prior_parm)

DESCRIPTION ^

 Return prior hyper-parameter using fMRI activity pattern. 
 
 [syntax]
 [a0,Ta0] = vb_set_vb_prior(prior_parm)

 [input]
 prior_parm: <<struct>> Prior specification parameters. 
 ---fields of prior_parm
  .ix     : <<int vector>>
  .a0     : <<float vector>> Normally equal to 1 [1]. 
  .a0_act : <<float vector>> Magnification parameter [1].
  .Ta0    : <<float vector>> gamma0 at minimum fMRI signal [2]. 
  .Ta0_act: <<float vector>> gamma0 at maximum fMRI signal [2]. 
  .v0     : <<float>> Noise-normalized current variance estimated by
            minimum norm estimation. 
 ---
 Model     : <<struct>> <optional> Model parameter set. 

 [output]
 a0 : <<float vector>> Noise-normalized current variance, alpha0^-1
      [2]. 
 Ta0: <<float vector>> Confidence parameter, gamma0 [2]. 

 [references]
 [1] Yoshioka et al., 2008. 
 [2] Sato et al., 2004. 

 [history]
 2008-06-27 Taku Yoshioka
 2010-09-16 Taku Yoshioka
  Bug fix (line 41): It doesn't have any effect if previously obtained
  'Model' is not used to set prior parameters. 

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [a0,Ta0] = vb_set_vb_prior(prior_parm)
0002 % Return prior hyper-parameter using fMRI activity pattern.
0003 %
0004 % [syntax]
0005 % [a0,Ta0] = vb_set_vb_prior(prior_parm)
0006 %
0007 % [input]
0008 % prior_parm: <<struct>> Prior specification parameters.
0009 % ---fields of prior_parm
0010 %  .ix     : <<int vector>>
0011 %  .a0     : <<float vector>> Normally equal to 1 [1].
0012 %  .a0_act : <<float vector>> Magnification parameter [1].
0013 %  .Ta0    : <<float vector>> gamma0 at minimum fMRI signal [2].
0014 %  .Ta0_act: <<float vector>> gamma0 at maximum fMRI signal [2].
0015 %  .v0     : <<float>> Noise-normalized current variance estimated by
0016 %            minimum norm estimation.
0017 % ---
0018 % Model     : <<struct>> <optional> Model parameter set.
0019 %
0020 % [output]
0021 % a0 : <<float vector>> Noise-normalized current variance, alpha0^-1
0022 %      [2].
0023 % Ta0: <<float vector>> Confidence parameter, gamma0 [2].
0024 %
0025 % [references]
0026 % [1] Yoshioka et al., 2008.
0027 % [2] Sato et al., 2004.
0028 %
0029 % [history]
0030 % 2008-06-27 Taku Yoshioka
0031 % 2010-09-16 Taku Yoshioka
0032 %  Bug fix (line 41): It doesn't have any effect if previously obtained
0033 %  'Model' is not used to set prior parameters.
0034 %
0035 % Copyright (C) 2011, ATR All Rights Reserved.
0036 % License : New BSD License(see VBMEG_LICENSE.txt)
0037 
0038 % If Model is given, Ta0 is calculated using 'Model.a'
0039 if isfield(prior_parm,'Model') & ~isempty(prior_parm.Model), 
0040   disp('Set prior by Wiener estimation result')
0041     
0042   a0 = Model.a;
0043   a0 = sum(a0,2)/size(a0,2);
0044   Ta0 = Ta0 + (Ta0_act-Ta0)*(a0./max(a0));
0045 else % If Model is not given, a0 & Ta0 is calculated using fMRI
0046   disp('Set prior fMRI activity pattern'); 
0047 
0048   % prior parameters
0049   v0       = prior_parm.v0;
0050   a0       = prior_parm.a0*v0; 
0051   a0_act   = prior_parm.a0_act*v0; 
0052   Ta0      = mean(prior_parm.Ta0); 
0053   Ta0_act  = mean(prior_parm.Ta0_act); 
0054   act      = prior_parm.act;
0055   
0056   % fMRI information
0057   xxP = act.xxP/max(act.xxP);
0058   xxP = xxP(prior_parm.ix);
0059     
0060   a0 = a0 + (a0_act-a0)*(xxP.^2); % square
0061   Ta0 = Ta0 + (Ta0_act-Ta0)*(xxP);  % linear
0062   %Ta0tmp = Ta0_act*ones(Nvact,1);     % Constant
0063 end;
0064 
0065 return;

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005