uqlab

MetaOpts.Type = 'Metamodel';
MetaOpts.MetaType = 'Kriging';

MetaOpts.ExpDesign.X = X;
MetaOpts.ExpDesign.Y = Y;

MetaOpts.EstimMethod = 'ML';
MetaOpts.Optim.Method = 'CMAES';

MetaOpts.ValidationSet.X = Xval;
MetaOpts.ValidationSet.Y = Yval;

myKriging = uq_createModel(MetaOpts);
uq_print(myKriging)
YKrg = uq_evalModel(myKriging,Xval);

uq_figure

cmap = uq_colorOrder(2);
uq_histogram(Yval, 'FaceColor', cmap(1,:))
hold on
uq_histogram(YKrg, 'FaceColor', cmap(2,:))
hold off

uq_legend(...
    {'FEM', 'Kriging'},...
    'Location', 'northeast')

xlabel('Critical buckling pressure (MPa)')
ylabel('Counts')

uq_figure

uq_plot(Yval, YKrg, '+')
hold on
uq_plot([min(Yval) max(Yval)], [min(Yval) max(Yval)],'k')
hold off

axis equal
axis([min(Yval) max(Yval) min(Yval) max(Yval)])

xlabel('$\mathrm{Y_{FEM}}$ (MPa)')
ylabel('$\mathrm{Y_{Krging}}$ (MPa)')