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

vb_baseline_variance_acquisition

PURPOSE ^

ACQUIRE THE CURRENT VARIANCE OF BASELINE

SYNOPSIS ^

function [v2,sx2] = vb_baseline_variance_acquisition(bayes_parm,nGall,Cov,sx);

DESCRIPTION ^

 ACQUIRE THE CURRENT VARIANCE OF BASELINE  

 --- Syntax
 1. [v2,sx2] = vb_baseline_variance_acquisition(bayes_parm,nGall);
 2. [v2,sx2] = vb_baseline_variance_acquisition(bayes_parm,nGall,Cov,sx);

 1. Update sx and v using a spherical covariance Cov = I (identity matrix)
 2. Fix sx using a given covariance matrix Cov

 --- Input
 (Field of bayes_parm)
 .megfile         : MEG file for current variance estimation
 .twin_baseline   : Time window for current variance estimation
 .megfile_baseline: MEG file for noise calculation
 .twin_noise      : Time window for noise estimation
 .noise_reg       : Regularization parameter for noise covariance
 .a_min           : 
 .a_max           :
 .Fdmin           :
 .update_v        : (本当に必要か?)
 .update_sx       : (本当に必要か?)
 .basisfile_global: (本当に必要か?)
 .basisfile       : (本当に必要か?)
 .variance_orientation: 
 .Tv0             :
 .Ta0             : 
 .temporal_filter (optional): 
 .trial_average   (optional): 

 --- History
 2005-08-17 O. Yamashita, ver.30b
 2005-08-17 O. Yamashita
 2006-08-10 M. Sato
   Use 'vbmeg_multi_fmri' for estimation
 2008-06-30 Taku Yoshioka 
   twin_global -> twin_baseline
 2011-08-26 taku-y
  [minor] 'bayes_parm.megfile_baseline' became effective. 

 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 [v2,sx2] = vb_baseline_variance_acquisition(bayes_parm,nGall,Cov,sx);
0002 % ACQUIRE THE CURRENT VARIANCE OF BASELINE
0003 %
0004 % --- Syntax
0005 % 1. [v2,sx2] = vb_baseline_variance_acquisition(bayes_parm,nGall);
0006 % 2. [v2,sx2] = vb_baseline_variance_acquisition(bayes_parm,nGall,Cov,sx);
0007 %
0008 % 1. Update sx and v using a spherical covariance Cov = I (identity matrix)
0009 % 2. Fix sx using a given covariance matrix Cov
0010 %
0011 % --- Input
0012 % (Field of bayes_parm)
0013 % .megfile         : MEG file for current variance estimation
0014 % .twin_baseline   : Time window for current variance estimation
0015 % .megfile_baseline: MEG file for noise calculation
0016 % .twin_noise      : Time window for noise estimation
0017 % .noise_reg       : Regularization parameter for noise covariance
0018 % .a_min           :
0019 % .a_max           :
0020 % .Fdmin           :
0021 % .update_v        : (本当に必要か?)
0022 % .update_sx       : (本当に必要か?)
0023 % .basisfile_global: (本当に必要か?)
0024 % .basisfile       : (本当に必要か?)
0025 % .variance_orientation:
0026 % .Tv0             :
0027 % .Ta0             :
0028 % .temporal_filter (optional):
0029 % .trial_average   (optional):
0030 %
0031 % --- History
0032 % 2005-08-17 O. Yamashita, ver.30b
0033 % 2005-08-17 O. Yamashita
0034 % 2006-08-10 M. Sato
0035 %   Use 'vbmeg_multi_fmri' for estimation
0036 % 2008-06-30 Taku Yoshioka
0037 %   twin_global -> twin_baseline
0038 % 2011-08-26 taku-y
0039 %  [minor] 'bayes_parm.megfile_baseline' became effective.
0040 %
0041 % Copyright (C) 2011, ATR All Rights Reserved.
0042 % License : New BSD License(see VBMEG_LICENSE.txt)
0043 
0044 if nargin ~= 2 & nargin ~=4
0045   error('Input arguments must be 2 or 4')
0046 end
0047 
0048 Njall = size(nGall{1},2);
0049 
0050 bayes_parm2 = bayes_parm;
0051 
0052 bayes_parm2.twin_meg = bayes_parm2.twin_baseline; 
0053 bayes_parm2.Tperiod  = ...
0054     bayes_parm2.twin_meg(2) - bayes_parm2.twin_meg(1) + 1;
0055 bayes_parm2.Tnext = bayes_parm2.Tperiod;
0056 
0057 bayes_parm2.Npre_train  = 100;    % = Ntrain
0058 bayes_parm2.Ntrain      = 100;    % : Do not use accelerated-update rule
0059 bayes_parm2.skip        = 20;
0060 bayes_parm2.noise_model = 1;    % Scaler noise model
0061 
0062 % modified by TY 2011-08-26
0063 bayes_parm2.megfile = bayes_parm.megfile_baseline; 
0064 
0065 if nargin == 2    
0066   % Estimate sensor noise variance
0067   wiener.update_sx = ON;
0068   [Cov]   = vb_observation_noise_specification(bayes_parm2);
0069   [B]     = vb_megdata_preparation(bayes_parm2);
0070   vb_parm = vb_set_vb_parm(bayes_parm2, B, [], Njall);
0071 elseif nargin == 4
0072   % Fix sensor noise variance
0073   wiener.update_sx = OFF;
0074   [B]     = vb_megdata_preparation(bayes_parm2);
0075   vb_parm = vb_set_vb_parm(bayes_parm2, B, [], Njall, [], sx);
0076 end
0077 
0078 wiener.update_v = ON;  % Estimate global current variance
0079 vb_parm.wiener  = wiener;
0080 
0081 % No fMRI bias information
0082 vb_parm.Ta0 = 0;
0083 vb_parm.Tv0 = 0;
0084 
0085 %[Model,Info] = vbmeg_ard_estimate2(B, nGall, [], Cov, vb_parm);
0086 [Model,Info] = vbmeg_multi_fmri(B, nGall, [], Cov, vb_parm);
0087 
0088 v2  = Model.v(1);    % global current variance
0089 sx2 = Model.sx;        % noise variance

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