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: spm_dcm_bpa.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function [BPA] = spm_dcm_bpa(P,nocd)
% Produce an aggregate DCM using Bayesian parameter averaging

    
function [BPA] = spm_dcm_bpa(P,nocd)
% Produce an aggregate DCM using Bayesian parameter averaging
% FORMAT [BPA] = spm_dcm_bpa(DCM,nocd)
%
% DCM  - {N [x M]} structure array of DCMs from N subjects
% ------------------------------------------------------------
%     DCM{i}.M.pE - prior expectations of P parameters
%     DCM{i}.M.pC - prior covariance
%     DCM{i}.Ep   - posterior expectations
%     DCM{i}.Cp   - posterior covariance
%
% nocd - optional flag for suppressing conditional depend