Here, I have a question to ask, when I use my own external dataset to construct the SSE surrogate model, the Uqlab always reports an error:the model property mFile, or mString or mHandle needs to be defined!
I’m sure my dataset is correct, because I used it and same code to build PCE and Kriging, which can run perfectly, and the LOO error is close to 0.
Therefore, I would like to ask you whether the dataset for constructing SSE model can be an external dataset (probabilistic finite element analysis results), or can it only be explicit function (like the example you gave)?
However, when using the SSE meta model, the following errors are reported:
The model property mFile, or mString or mHandle needs to be defined!
uq_initialize_uq_default_model (line 30)
error(‘The model property mFile, or mString or mHandle needs to be defined!’)
uq_core_module/run_initialization_script (line 208)
initHandle(obj);
uq_core_model/add_module (line 100)
success = this.run_initialization_script(obj);
uq_createModel (line 116)
eval(str);
Copy_of_uq_Example_SSE_04_multipleOutputs (line 32)
mySSE = uq_createModel(MetaOpts);
I look forward to your help, and thank you very much.
Best regards
As you can see, the first three lines are lowercase, while the following are uppercase. Matlab is case-sensitive, so you are not telling UQLab to create a Metamodel. It’s easily fixed by making the first three lines uppercase (metaOpts => MetaOpts).
Here I want to report a possible small mistake.
When I run ‘Example_ SSE_ 01_ complexFunction’ with my own dataset(Multiple output),
myFigures = uq_display(mySSE, [1]);
%% I used this code in PCE to specify that the output which can run perfectly
However, The system reports the following errors:
You can specify the outputs you want to be displayed with the syntax:
uq_display(SSEModule, OUTARRAY)
where OUTARRAY is the index of desired outputs, e.g. 1:3 for the first three
Error: Expected one output from a curly bracket or dot index expression, but the result was 10
Then I change the code as prompted:
myFigures = uq_display(mySSE, {1:3});
or
myFigures = uq_display(mySSE, [1:3]);
or
myFigures = uq_display(mySSE, 1);
or etc ;
The results all reported the same error. I didn’t find a solution in the manual, so I can only ask again here.
I’m very sorry to disturb you and hope you have a nice weekend!
So I think it might not be as simple as I thought, and maybe the problem gets complicated after having specified a single output of choice in the multiple output.
I hope you give me advice again, thank you very much.
Unfortunately I cannot dedicate time for individual custom requests, but I will ask the dev team to investigate the inconsistency.
Just two small comments:
returning figure handles from uq_display is a feature in its infancy, there was no time to properly design and propagate it throughout the various modules for this release, so I’m not surprised about inconsistencies. It will be addressed in the next UQLab releases.
uq_display is intended as a quick diagnostic/visualization tool, so I strongly recommend creatong your own visualization routines for publications/reports/etc.
I modified ‘Example_ SSE_ 01_ complexFunction’ to have multiple outputs, but I cannot reproduce your error. In my case, myFigures = uq_display(mySSE,1) is an array of dimension 1\times2 (the first figure is the partition of the input space, and the second one illustrates the tree). Note that myFigures = uq_display(mySSE) is equivalent to the previous case: if the output array is not specified, uq_display will plot only those of the first output. Besides, myFigures = uq_display(mySSE,1:3) produces an array of 1\times6, as every output is associated with two figures.
The line plotAx = myFigures{1}.Children(2) extracts the upper plot of the first figure that shows the training points and the SSE fit. When running this line, you should keep the window of the figures open.
Could you please try again? If the problem persists, could you please share your code here so that I can further look for the issue?
Dear Xu:
Thanks for your help.
I still failed to solve the problem, here I post the code.
In my code I used two sets of external datasets to construct the SSE.
The case1 is a single output and it works perfectly; the case2 is 10 D multiple output, the previous error pop up when I specify a single output use myFigures = uq_display(mySSE,1) , so that I can’t generate fit and compare plots for SSE and PCE.
%% case 1
FILELOCATION = fullfile(uq_rootPath, 'Examples', 'SimpleDataSets',...
'supportbeam');
load(fullfile(FILELOCATION,'Supportbeam_DOE40.mat'), 'X', 'Y');
load(fullfile(FILELOCATION,'Supportbeam_VAL30.mat'), 'Xval', 'Yval');
%% 3 - PRIOR DISTRIBUTION OF THE MODEL PARAMETERS
Input.Marginals(1).Name = 'E'; % Young's modulus
Input.Marginals(1).Type = 'Lognormal';
Input.Marginals(1).Moments = [30e9 4.5e9]; % (N/m^2)
myInput = uq_createInput(Input);
Thanks for sharing the code. In Case 2, myFigures = uq_display(mySSE,1) indeed produces a cell of size 1\times 3: the first one is the “partition of quantile space”, the second one is “partition physical space” and the third one is the partition tree. As there is no subplot in the first figure (it shows only the partition of the quantile space), plotAx = myFigures{1}.Children(2) will not be able to access its second “children”.
The difference between Case 1 and Case 2 is the input dimension. In Case 1, we have only one input, and uq_display (Line 168) calls the function uq_SSE_display_partition_physical1D which plots both the partition and the fitted curve. That’s why there are two Children of this figure. In Case 2, however, we have two input variables. In this case, uq_display (Line 170) calls the function uq_SSE_display_partition_physical2D which plots the partition in the physical space. The difference is NOT a bug, as the figures are designed to work with different input dimensions, e.g., we cannot plot the “curve” for examples with more than one input variable (Case 2).
As @ste mentioned, I recommend creating your own routines for plotting.