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_AuthorTopic_RunInference.m
    path of file: ./repos/CBIG/stable_projects/meta-analysis/Ngo2019_AuthorTopic/utilities/inference
    
    the code of the file until where you have to start completion: function CBIG_AuthorTopic_RunInference(seed, K, alpha, eta, doSmoothing, baseDirectory, dataPath, burnin, isSavingPhi)
  % CBIG_AuthorTopic_RunInference(seed, K, alpha, eta, doSmoothing, baseDirectory, dataPath, burnin, isSavingPhi)
  %
  % Wrapper function to estimate the author-topic models parameters using the Collapsed Variational Bayes (CVB) algorithm.
  %
  % Input:
  %  - seed: random initialization (seed) used for the current run of the CVB algorithm.
  %  - K: number of components of the author-topic model.
  %  - alpha & eta: hyperparameters of the Dirichlet priors of the author-topic model
  %  - doSmoothing: if doSmoothing > 1, performs spatial smoothing of the CVB algorithm's variational distribution. If doSmoothing = 0, do not perform spatial smoothing.
  %  - baseDirectory: absolute path to the base directory containing the output of the current CVB algorithm's run.
  %  - dataPath: absolute path to the .mat file containing the author-topic model's input data.
  %  - burnin: number of iterations performed by the CVB algorithm before checking for convergence. The default is set by CBIG_AuthorTopic_SetupParameters.m
  %  - isSavingPhi: if isSavingPhi > 1, the variational distribution of the CVB algorithm is saved. If isSavingPhi = 0, the variational distribution of the CVB algorithm is not saved (e.g. to save storage space). Default value: 0.

    
function CBIG_AuthorTopic_RunInference(seed, K, alpha, eta, doSmoothing, baseDirectory, dataPath, burnin, isSavingPhi)
  % CBIG_AuthorTopic_RunInference(seed, K, alpha, eta, doSmoothing, baseDirectory, dataPath, burnin, isSavingPhi)
  %
  % Wrapper function to estimate the author-topic models parameters using the Collapsed Variational Bayes (CVB) algorithm.
  %
  % Input:
  %  - seed: random initialization (seed) used for the current run of the CVB algorithm.
  %  - K: number of components of the author-topic model.
  %  - alpha & eta: hyperparameters of the Dirichlet priors of the author-topic model
  %  - doSmoothing: if doSmoothing > 1, performs spatial smoothing of the CVB algorithm's variational distribution. If doSmoothing = 0, do not perform spatial smoothing.
  %  - baseDirectory: absolute path to the base directory containing the output of the current CVB algorithm's run.
  %  - dataPath: absolute path to the .mat file containing the author-topic model's input data.
  %  - burnin: number of iterations performed by the CVB algorithm before checking for convergence. The default is set by CBIG_AuthorTopic_SetupParameters.m
  %  - isSavingPhi: if isSavingPhi > 1, the variational distribution of the CVB algorithm is saved. If isSavingPhi = 0, the variational distribution of the CVB algorithm is not saved (e.g. to save storage space). Default value: 0.
  %  Output:
  %  - The estimates of the author-topic model's parameters are saved at <baseDirectory>/outputs/K<K>/alpha<alpha>_eta<eta>/params_K<K>_SEED<seed>.mat
  %
  % Example:
  %   CBIG_AuthorTopic_RunInference(23, 2, 100, 0.01, 1, '/AT_outputs', '/data/selfGeneratedData.mat', 50, 1)
  %   Estimate the author-topic model's parameters by the CVB algorithm. The CVB algorithm is initialized with the random seed 23, hyperparameters alpha = 100 & eta = 0.01. The author-topic model is assumed to have 2 components. The CVB algorithm's variational distribution is spatially smoothed and has its output saved at /AT_outputs. The algorithm uses input saved in /data/selfGeneratedData.mat. The CVB algorithm runs for 50 iterations before checking for convergence and its variational distribution is saved in the output. The output file is /AT_outputs/outputs/K2/alpha100_eta0.01/params_K2_SEED23.mat
  %
  % Written by Gia H. Ngo and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

  % Format arguments if necessary
  if (ischar(seed))
    seed = str2num(seed); %#ok<*ST2NM>
  end