You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: CBIG_AuthorTopicEM_InitParams.m
    path of file: ./repos/CBIG/stable_projects/meta-analysis/Yeo2015_AuthorTopicEM/utilities/inference
    
    the code of the file until where you have to start completion: function params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params)
% params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params)
%
% Initialize parameters of the author-topic model
%
% Input:
%   - exp_acts        = D x 1 cell where D is the number of experiments
%                       exp_acts{d} is a Nd x V sparse matrix, where Nd is the number of activation foci
%                       in the experiment, and V is the number of brain voxels. exp_acts{d}(n, j) = 1
%                       if nth activation focus of experiment d is j-th brain voxel.
%   - paradigm_by_exp = A x D logical sparse matrix, where A is the number of paradigms,
%                       D is the number of experiments.
%                       paradigm_by_exp(a, d) = 1 if paradigm "a" is in experiment d
%   - params          = struct of models' parameters declared in CBIG_AuthorTopic_EM_CreateEmptyParams
%
% Output:
%   - params          = initialized models' parameters
%
% Example:
%   params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params)
%   Initialize parameters of the author-topic model with the activation foci of the experiments defined in
%   exp_acts, task paradigms of the experiments defined in paradigm_by_exp, and the initial parameters
%   stored in params.

    
function params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params)
% params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params)
%
% Initialize parameters of the author-topic model
%
% Input:
%   - exp_acts        = D x 1 cell where D is the number of experiments
%                       exp_acts{d} is a Nd x V sparse matrix, where Nd is the number of activation foci
%                       in the experiment, and V is the number of brain voxels. exp_acts{d}(n, j) = 1
%                       if nth activation focus of experiment d is j-th brain voxel.
%   - paradigm_by_exp = A x D logical sparse matrix, where A is the number of paradigms,
%                       D is the number of experiments.
%                       paradigm_by_exp(a, d) = 1 if paradigm "a" is in experiment d
%   - params          = struct of models' parameters declared in CBIG_AuthorTopic_EM_CreateEmptyParams
%
% Output:
%   - params          = initialized models' parameters
%
% Example:
%   params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params)
%   Initialize parameters of the author-topic model with the activation foci of the experiments defined in
%   exp_acts, task paradigms of the experiments defined in paradigm_by_exp, and the initial parameters
%   stored in params.
%
% Written by B.T.Thomas Yeo and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

  params.T = size(paradigm_by_exp, 1);
  params.V = size(exp_acts{1}, 2);
  params.E = length(exp_acts);
  
  if(sum(params.brain_mask.vol(:) == 1) ~= params.V)
     error('Brain mask is different size from dictionary'); 
  end