Error with uq_inversion_likelihood for calibration of a multi-output model

Goodevening, I’am trying to reproduce the example present in user_manual_inversion at chapter 2.3, the example is working fine but when I substitute the model function with the one needed for my case study I always get the same error:

Error using uq_inversion_likelihood
Unable to perform assignment because the size of the left side is 100-by-27 and the size of the right side is 1-by-27.

When I consider a single output the algorithm works fine, Nevertheless the definition of my response function for the model is carrying out a row vector (1x27) and the observations have the same size. Using multiple models with one single output I can bypass the problem but the computational cost of the analysis become huge since I have to evaluate 27 single models. If someone could kindly spot where is the problem it will be perfect, thank you very much, the code is pasted as a reference:

uqlab

rng(100,‘twister’)

ModelOpts.Name = ‘Forward model’;

ModelOpts.mFile = ‘FM’;

myForwardModel = uq_createModel(ModelOpts);

modelopts.isVectorized = false;

PriorOpts.Marginals(1).Name = ‘T1’;

PriorOpts.Marginals(1).Type = ‘uniform’;

PriorOpts.Marginals(1).Parameters = [0.5 2]; % (m)

PriorOpts.Marginals(2).Name = ‘T2’;

PriorOpts.Marginals(2).Type = ‘uniform’;

PriorOpts.Marginals(2).Parameters = [0.5 2]; % (m)

PriorOpts.Marginals(3).Name = ‘T3’;

PriorOpts.Marginals(3).Type = ‘uniform’;

PriorOpts.Marginals(3).Parameters = [0.01 5]; % (m)

PriorOpts.Marginals(4).Name = ‘T4’;

PriorOpts.Marginals(4).Type = ‘uniform’;

PriorOpts.Marginals(4).Parameters = [0.01 2.5] ; % (N/mˆ2)

myPriorDist = uq_createInput(PriorOpts);

DiscrepancyOpts.Type = ‘Gaussian’;

DiscrepancyOpts.Parameters = 2e3;

BayesOpts.Discrepancy = DiscrepancyOpts;

V = transpose(B_1(:,3));

myData.Name = ‘Critical Massflowrate’;

myData.y = V;

BayesOpts.Type = ‘Inversion’;

BayesOpts.Data = myData;

BayesOpts.Prior = myPriorDist;

myBayesianAnalysis = uq_createAnalysis(BayesOpts);

uq_postProcessInversion(myBayesianAnalysis,‘priorPredictive’,1000);

uq_print(myBayesianAnalysis)

uq_display(myBayesianAnalysis)

Dear @Thomas_1,

Thanks for asking here. In order to help us better understand the issue, could you please provide a minimum working example that can reproduce the problem?

Best,
Xujia

Thank you very much for your reply, I managed to find the error in my code. It was a typo in modelops specifications regarding model vectorialization. This topic can be closed.

Thanks again

Thanks for the feedback. I’m glad to know that the problem has been solved. Have fun with UQLab!

All the best,
Xujia