How to correct errors related to likelihood function in Bayesian inference

I’m trying to apply UQ Lab Bayesian inference to my problem.
Summary of UQ setting for my problem is like below:

  1. Input : velocity (1 X 56)
  2. Parameter: 3
  3. Measurement data : pressure drop (1 X 56)
  4. Model output : caculated pressure drop(# of chain X 56)
  5. MCMC model setting - solver : MCMC, sampler: AIES, steps: 500, nchain : 100
    There was a warning related to likelihood function :

Unable to perform assignment because the size of the left side is 100-by-56 and the size of the right side is 1-by-56.

Error in uq_inversion_likelihood (line 64)
** modelRunsCurr(:,ModelIDCurr == jj) = forwardModel(jj).evaluation(:,OutputIDCurrModel);**

Error in uq_initialize_uq_inversion>@(x)uq_inversion_likelihood(x,Internal,‘LogLikelihood’) (line 497)
** Internal.LogLikelihood = @(x) uq_inversion_likelihood(x,Internal,‘LogLikelihood’);**

Error in uq_AIES (line 67)
** [logLKLHD_Curr, forwardModel_Curr] = LogLikelihood(reshape(Seed,nDim,nChains).’);**

Error in uq_inversion (line 91)
** Results.LogLikeliEval] = uq_AIES(…**

Error in uq_initialize_uq_inversion (line 752)
uq_runAnalysis(CurrentAnalysis);

Error in UQ_1209 (line 126)
myBayesianAnalysisUnknownDisc = uq_createAnalysis(BayesOpts);

I tried this with one parameter ( the other setting was all same). No warnings popped up and had good estimates.
But, after I the number of parameters, this warning came out and couldn’t fix it. Is there any points I need to correct?

Hi, @Yesol,
did you solve this problem already?
I think your problem is related to the input of the samples and output matrices.
The input sample matrix must be of dimension Ns x M and the output matrix Ns x Nout, where Ns is the number of samples, M is the number of variables in your model, and Nout is the number of different outputs you want to analyze.
Let me know
Best
Gian

1 Like

Yes, I solved the problem.
As you said, dimension was the problem!