DSPC Standard Layers#

This shows an example of using a standard layers model to analyse reflectivity from a floating bilayer of DSPC.

The model is set up in the script, we set Gaussian priors on some of the parameters, build the two contrasts, run the calculation and plot the results.

This example can be run as a script or interactively using the instructions below.

Run Script:

root = getappdata(0, 'root');
cd(fullfile(root, 'examples', 'normalReflectivity', 'standardLayers'));
standardLayersDSPCScript

Run Interactively:

root = getappdata(0, 'root');
cd(fullfile(root, 'examples', 'normalReflectivity', 'standardLayers'));
edit standardLayersDSPCSheet.mlx
Standard Layers Analysis of a DSPC Floating Bilayer

Standard Layers Analysis of a DSPC Floating Bilayer

In this worksheet, we will carry out an analysis of a floating bilayer sample using a 'standard layers' model.
The sample consists of a DSPC bilayer, on a silane SAM on Silicon as follows.....
So we are going to need layers for Oxide, SAM tails, SAM heads, and the Heads/Tails of the Bilayer. We also need to consider hydration of the submerged bilayer.
Start by making a project....
% Make the project
problem = createProject(name='original_dspc_bilayer', calcType='normal', model='standard layers', geometry='substrate/liquid', absorption=false);
 
% Make priors visible..
problem.showPriors = true;
The add the parameters we are going to need to this....
paramGroup = {
{'Oxide thick', 5, 19.54, 60, true, 'uniform', 0, Inf};
{'Oxide SLD', 3.39e-06, 3.39e-06, 3.41e-06, false, 'uniform', 0, Inf};
{'Sam tails thick', 15, 22.66, 35, true, 'uniform', 0, Inf};
{'Sam tails SLD', -5e-07, -4.01e-07, -3e-07, false, 'uniform', 0, Inf};
{'Sam tails hydration', 1, 5.253, 50, true, 'uniform', 0, Inf};
{'Sam rough', 1, 5.64, 15, true, 'uniform', 0, Inf};
{'cw thick', 10, 17.12, 28, true, 'uniform', 0, Inf};
{'cw SLD', 0, 0, 1e-09, false, 'uniform', 0, Inf};
{'SAM head thick', 5, 8.56, 17, true, 'gaussian', 10, 2};
{'SAM head SLD', 1e-07, 1.75e-06, 2e-06, false, 'uniform', 0, Inf};
{'SAM head hydration', 10, 45.45, 50, true, 'uniform', 30, 3};
{'Bilayer head thick', 7, 10.70, 17, true, 'gaussian', 10, 2};
{'Bilayer head SLD', 5e-07, 1.47e-06, 1.5e-06, false, 'uniform', 0, Inf};
{'Bilayer rough', 2, 6.014, 15, true, 'uniform', 0, Inf};
{'Bilayer tails thick', 14, 17.82, 22, true, 'uniform', 0, Inf};
{'Bilayer tails SLD', -5e-07, -4.610e-07, 0, false, 'uniform', 0, Inf};
{'Bilayer tails hydr', 10, 17.64, 50, true, 'uniform', 0, Inf};
{'Bilayer heads hydr', 10, 36.15, 50, true, 'gaussian', 30, 3};
{'cw hydration', 99.9, 100, 100, false, 'uniform', 0, Inf};
{'Oxide Hydration', 0, 23.61, 60, true, 'uniform', 0, Inf};
};
problem.addParameterGroup(paramGroup);
Warning: mu cannot be 30 when the prior types is not Gaussian - resetting to 0
Warning: sigma cannot be 3 when the prior types is not Gaussian - resetting to Inf
 
% In addition to these, there is also Substrate Roughness which is always
% parameter 1. Increase the allowed range of this a bit....
problem.setParameter(1,'max',10);
Now we can group these parameters into the layers we need, and add them to the project......
% Group these into layers....
Layers = {
{'Oxide', 'Oxide thick', 'Oxide SLD', 'substrate roughness', 'Oxide Hydration', 'bulk out'};
{'Sam tails', 'Sam tails thick', 'Sam tails SLD', 'Sam rough', 'Sam tails hydration', 'bulk out'};
{'Sam heads', 'SAM head thick', 'SAM head SLD', 'Sam rough', 'SAM head hydration', 'bulk out'};
{'Central water', 'cw thick', 'cw SLD', 'Bilayer rough', 'cw hydration', 'bulk out'};
{'Bilayer heads', 'Bilayer head thick', 'Bilayer head SLD', 'Bilayer rough', 'Bilayer heads hydr', 'bulk out'};
{'Bilayer tails', 'Bilayer tails thick', 'Bilayer tails SLD','Bilayer rough', 'Bilayer tails hydr', 'bulk out'};
};
problem.addLayerGroup(Layers);
Now deal with the experimental params. We need a bulk in of Silicon, and two Bulk outs - D2O and SMW
% Remove the existing default first (we could just rename it and change the
% values, of course....)
problem.removeBulkIn(1);
problem.addBulkIn('Silicon', 2e-06, 2.073e-06, 2.1e-06, false);
 
%.... ditto bulk out....
problem.removeBulkOut(1);
problem.addBulkOut('D2O', 5.50e-06, 5.98e-06, 6.4e-06, true);
problem.addBulkOut('SMW', 1e-06, 2.21e-06, 4.99e-06, true);
Likewise the scalefactors and backgrounds......
% Set the scalefactors - use one for each contrast
problem.removeScalefactor(1);
problem.addScalefactor('Scalefactor 1', 0.05, 0.10, 0.2, true);
problem.addScalefactor('Scalefactor 2', 0.05, 0.15, 0.2, true);
 
% Now deal with the backgrounds....
problem.removeBackgroundParam(1);
problem.addBackgroundParam('Backs parameter D2O', 5e-10, 2.23e-06, 7e-06, true);
problem.addBackgroundParam('Backs parameter SMW', 1e-10, 3.38e-06, 4.99e-06, true);
 
problem.removeBackground(1);
problem.addBackground('D2O Background','constant','Backs parameter D2O');
problem.addBackground('SMW Background','constant','Backs parameter SMW');
Now load in and add the data....
d2o_dat = readmatrix('DSPC_D2O.dat');
problem.addData('dspc_bil_d2O', d2o_dat);
 
smw_dat = readmatrix('DSPC_SMW.dat');
problem.addData('dspc_bil_smw', smw_dat);
Finally, we build everything up into the two contrasts.....
stack = {'Oxide',...
'Sam tails',...
'Sam heads',...
'Central water',...
'Bilayer heads',...
'Bilayer tails',...
'Bilayer tails',...
'Bilayer heads',...
};
 
problem.addContrast('name', 'D2O',...
'BulkIn', 'Silicon',...
'BulkOut', 'D2O',...
'background', 'D2O Background',...
'resolution', 'Resolution 1',...
'scalefactor', 'Scalefactor 1',...
'data', 'dspc_bil_d2o',...
'model', stack);
 
problem.addContrast('name', 'SMW',...
'BulkIn', 'Silicon',...
'BulkOut', 'SMW',...
'background', 'SMW Background',...
'resolution', 'Resolution 1',...
'scalefactor', 'Scalefactor 2',...
'data', 'dspc_bil_smw',...
'model', stack);
Display our project, to check what we have....
% Just the name of the project with no semicolon.....
problem
problem =
modelType: 'standard layers' experimentName: 'original_dspc_bilayer' geometry: 'substrate/liquid' Parameters: ---------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma __ _____________________ ________ _________ ________ _____ __________ __ _____ 1 "Substrate Roughness" 1 3 10 true "uniform" 0 Inf 2 "Oxide thick" 5 19.54 60 true "uniform" 0 Inf 3 "Oxide SLD" 3.39e-06 3.39e-06 3.41e-06 false "uniform" 0 Inf 4 "Sam tails thick" 15 22.66 35 true "uniform" 0 Inf 5 "Sam tails SLD" -5e-07 -4.01e-07 -3e-07 false "uniform" 0 Inf 6 "Sam tails hydration" 1 5.253 50 true "uniform" 0 Inf 7 "Sam rough" 1 5.64 15 true "uniform" 0 Inf 8 "cw thick" 10 17.12 28 true "uniform" 0 Inf 9 "cw SLD" 0 0 1e-09 false "uniform" 0 Inf 10 "SAM head thick" 5 8.56 17 true "gaussian" 10 2 11 "SAM head SLD" 1e-07 1.75e-06 2e-06 false "uniform" 0 Inf 12 "SAM head hydration" 10 45.45 50 true "uniform" 0 Inf 13 "Bilayer head thick" 7 10.7 17 true "gaussian" 10 2 14 "Bilayer head SLD" 5e-07 1.47e-06 1.5e-06 false "uniform" 0 Inf 15 "Bilayer rough" 2 6.014 15 true "uniform" 0 Inf 16 "Bilayer tails thick" 14 17.82 22 true "uniform" 0 Inf 17 "Bilayer tails SLD" -5e-07 -4.61e-07 0 false "uniform" 0 Inf 18 "Bilayer tails hydr" 10 17.64 50 true "uniform" 0 Inf 19 "Bilayer heads hydr" 10 36.15 50 true "gaussian" 30 3 20 "cw hydration" 99.9 100 100 false "uniform" 0 Inf 21 "Oxide Hydration" 0 23.61 60 true "uniform" 0 Inf Bulk In: -------------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma _ _________ _____ _________ _______ _____ __________ __ _____ 1 "Silicon" 2e-06 2.073e-06 2.1e-06 false "uniform" 0 Inf Bulk Out: ------------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma _ _____ _______ ________ ________ _____ __________ __ _____ 1 "D2O" 5.5e-06 5.98e-06 6.4e-06 true "uniform" 0 Inf 2 "SMW" 1e-06 2.21e-06 4.99e-06 true "uniform" 0 Inf Scalefactors: ------------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma _ _______________ ____ _____ ___ _____ __________ __ _____ 1 "Scalefactor 1" 0.05 0.1 0.2 true "uniform" 0 Inf 2 "Scalefactor 2" 0.05 0.15 0.2 true "uniform" 0 Inf Backgrounds: ----------------------------------------------------------------------------------------------- (a) Background Parameters: p Name Min Value Max Fit? Prior Type mu sigma _ _____________________ _____ ________ ________ _____ __________ __ _____ 1 "Backs parameter D2O" 5e-10 2.23e-06 7e-06 true "uniform" 0 Inf 2 "Backs parameter SMW" 1e-10 3.38e-06 4.99e-06 true "uniform" 0 Inf (b) Backgrounds: p Name Type Source Value 1 Value 2 Value 3 Value 4 Value 5 _ ________________ __________ _____________________ _______ _______ _______ _______ _______ 1 "D2O Background" "constant" "Backs parameter D2O" "" "" "" "" "" 2 "SMW Background" "constant" "Backs parameter SMW" "" "" "" "" "" Resolutions: --------------------------------------------------------------------------------------------- (a) Resolutions Parameters: p Name Min Value Max Fit? Prior Type mu sigma _ __________________ ____ _____ ____ _____ __________ __ _____ 1 "Resolution par 1" 0.01 0.03 0.05 false "uniform" 0 Inf (b) Resolutions: p Name Type Source Value 1 Value 2 Value 3 Value 4 Value 5 _ ______________ __________ __________________ _______ _______ _______ _______ _______ 1 "Resolution 1" "constant" "Resolution par 1" "" "" "" "" "" Layers: -------------------------------------------------------------------------------------------------- p Name Thickness SLD Roughness Hydration Hydrate with _ _______________ _____________________ ___________________ _____________________ _____________________ ____________ 1 "Oxide" "Oxide thick" "Oxide SLD" "Substrate Roughness" "Oxide Hydration" "bulk out" 2 "Sam tails" "Sam tails thick" "Sam tails SLD" "Sam rough" "Sam tails hydration" "bulk out" 3 "Sam heads" "SAM head thick" "SAM head SLD" "Sam rough" "SAM head hydration" "bulk out" 4 "Central water" "cw thick" "cw SLD" "Bilayer rough" "cw hydration" "bulk out" 5 "Bilayer heads" "Bilayer head thick" "Bilayer head SLD" "Bilayer rough" "Bilayer heads hydr" "bulk out" 6 "Bilayer tails" "Bilayer tails thick" "Bilayer tails SLD" "Bilayer rough" "Bilayer tails hydr" "bulk out" Custom Files: ------------------------------------------------------------------------------------------------------ Name Filename Function Name Language Path ____ ________ _____________ ________ ____ "" "" "" "" "" Data: ------------------------------------------------------------------------------------------------------ Name Data Data Range Simulation Range ______________ ______________________ _____________________ _____________________ "Simulation" "No Data" "-" "[ 0.0050 , 0.7000 ]" "dspc_bil_d2O" "Data array: [82 x 3]" "[ 0.0114 , 0.5934 ]" "[ 0.0114 , 0.5934 ]" "dspc_bil_smw" "Data array: [82 x 3]" "[ 0.0114 , 0.5934 ]" "[ 0.0114 , 0.5934 ]" Contrasts: ----------------------------------------------------------------------------------------------- p 1 2 ___________________ ________________ ________________ "Name" "D2O" "SMW" "Data" "dspc_bil_d2O" "dspc_bil_smw" "Background" "D2O Background" "SMW Background" "Background Action" "add" "add" "Bulk in" "Silicon" "Silicon" "Bulk out" "D2O" "SMW" "Scalefactor" "Scalefactor 1" "Scalefactor 2" "Resolution" "Resolution 1" "Resolution 1" "Resample" "false" "false" "Model" "Oxide" "Oxide" "" "Sam tails" "Sam tails" "" "Sam heads" "Sam heads" "" "Central water" "Central water" "" "Bilayer heads" "Bilayer heads" "" "Bilayer tails" "Bilayer tails" "" "Bilayer tails" "Bilayer tails" "" "Bilayer heads" "Bilayer heads"

Running the Project....

To run a project in RAT, we first need to define a controls block....
controls = controlsClass()
controls =
controlsClass with properties: parallel: 'single' procedure: 'calculate' calcSldDuringFit: 0 display: 'iter' resampleMinAngle: 0.9000 resampleNPoints: 50
The devaults action ('procedure') is just a single caclulation. So send out project to RAT with this, and then plot our our initial starting position...
[problem,results] = RAT(problem,controls);
Starting RAT ________________________________________________________________________________________________ Elapsed time is 0.230676 seconds. Finished RAT ______________________________________________________________________________________________
figure
plotRefSLD(problem,results);
We are as expected, a little off. Run some Differential Evolution on this.....
controls.procedure = 'DE';
controls.display = 'final' % Turn off per-iteration updates....
controls =
controlsClass with properties: parallel: 'single' procedure: 'de' calcSldDuringFit: 0 display: 'final' updateFreq: 1 updatePlotFreq: 20 populationSize: 20 fWeight: 0.5000 crossoverProbability: 0.8000 strategy: 4 targetValue: 1 numGenerations: 500 resampleMinAngle: 0.9000 resampleNPoints: 50
Note that now, the relevant parameters for Differential Evoultion appear in Controls. We can change these at this point if we want (e.g. controls.populationSize = 50 etc), but we'll go with the defaults for now....
[problem,results] = RAT(problem,controls);
Starting RAT ________________________________________________________________________________________________ Running Differential Evolution Final chi squared is 7.34657 Elapsed time is 3.843591 seconds. Finished RAT ______________________________________________________________________________________________
figure
plotRefSLD(problem,results)
This is decent starting point, but we really want a Bayesian analysis. To do this just select DREAM in controls.....
controls.procedure = 'dream'
controls =
controlsClass with properties: parallel: 'single' procedure: 'dream' calcSldDuringFit: 0 display: 'final' resampleMinAngle: 0.9000 resampleNPoints: 50 nSamples: 20000 nChains: 10 jumpProbability: 0.5000 pUnitGamma: 0.2000 boundHandling: 'reflect' adaptPCR: 1
Again we'll just go with the defaults.....
[problem,results] = RAT(problem,controls)
Starting RAT ________________________________________________________________________________________________ Running DREAM ------------------ Summary of the main settings used ------------------ nParams: 20 nChains: 10 nGenerations: 2000 parallel: false CPU: 1 jumpProbability: 0.5 pUnitGamma: 0.2 nCR: 3 delta: 3 steps: 50 zeta: 1e-12 outlier: 'iqr' adaptPCR: true thinning: 1 ABC: false epsilon: 0.025 IO: false storeOutput: false R: [10x10 double] ----------------------------------------------------------------------- DREAM: 100.0% [****************************************] Elapsed time is 16.784423 seconds. Finished RAT ______________________________________________________________________________________________
problem =
modelType: 'standard layers' experimentName: 'original_dspc_bilayer' geometry: 'substrate/liquid' Parameters: ---------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma __ _____________________ ________ _________ ________ _____ __________ __ _____ 1 "Substrate Roughness" 1 4.4869 10 true "uniform" 0 Inf 2 "Oxide thick" 5 18.913 60 true "uniform" 0 Inf 3 "Oxide SLD" 3.39e-06 3.39e-06 3.41e-06 false "uniform" 0 Inf 4 "Sam tails thick" 15 22.787 35 true "uniform" 0 Inf 5 "Sam tails SLD" -5e-07 -4.01e-07 -3e-07 false "uniform" 0 Inf 6 "Sam tails hydration" 1 10.481 50 true "uniform" 0 Inf 7 "Sam rough" 1 4.4106 15 true "uniform" 0 Inf 8 "cw thick" 10 18.049 28 true "uniform" 0 Inf 9 "cw SLD" 0 0 1e-09 false "uniform" 0 Inf 10 "SAM head thick" 5 9.9354 17 true "gaussian" 10 2 11 "SAM head SLD" 1e-07 1.75e-06 2e-06 false "uniform" 0 Inf 12 "SAM head hydration" 10 28.349 50 true "uniform" 0 Inf 13 "Bilayer head thick" 7 9.8557 17 true "gaussian" 10 2 14 "Bilayer head SLD" 5e-07 1.47e-06 1.5e-06 false "uniform" 0 Inf 15 "Bilayer rough" 2 6.6472 15 true "uniform" 0 Inf 16 "Bilayer tails thick" 14 17.744 22 true "uniform" 0 Inf 17 "Bilayer tails SLD" -5e-07 -4.61e-07 0 false "uniform" 0 Inf 18 "Bilayer tails hydr" 10 16.611 50 true "uniform" 0 Inf 19 "Bilayer heads hydr" 10 30.58 50 true "gaussian" 30 3 20 "cw hydration" 99.9 100 100 false "uniform" 0 Inf 21 "Oxide Hydration" 0 21.703 60 true "uniform" 0 Inf Bulk In: -------------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma _ _________ _____ _________ _______ _____ __________ __ _____ 1 "Silicon" 2e-06 2.073e-06 2.1e-06 false "uniform" 0 Inf Bulk Out: ------------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma _ _____ _______ __________ ________ _____ __________ __ _____ 1 "D2O" 5.5e-06 5.9697e-06 6.4e-06 true "uniform" 0 Inf 2 "SMW" 1e-06 2.1642e-06 4.99e-06 true "uniform" 0 Inf Scalefactors: ------------------------------------------------------------------------------------------------- p Name Min Value Max Fit? Prior Type mu sigma _ _______________ ____ _______ ___ _____ __________ __ _____ 1 "Scalefactor 1" 0.05 0.10363 0.2 true "uniform" 0 Inf 2 "Scalefactor 2" 0.05 0.10347 0.2 true "uniform" 0 Inf Backgrounds: ----------------------------------------------------------------------------------------------- (a) Background Parameters: p Name Min Value Max Fit? Prior Type mu sigma _ _____________________ _____ __________ ________ _____ __________ __ _____ 1 "Backs parameter D2O" 5e-10 2.3318e-06 7e-06 true "uniform" 0 Inf 2 "Backs parameter SMW" 1e-10 2.9295e-06 4.99e-06 true "uniform" 0 Inf (b) Backgrounds: p Name Type Source Value 1 Value 2 Value 3 Value 4 Value 5 _ ________________ __________ _____________________ _______ _______ _______ _______ _______ 1 "D2O Background" "constant" "Backs parameter D2O" "" "" "" "" "" 2 "SMW Background" "constant" "Backs parameter SMW" "" "" "" "" "" Resolutions: --------------------------------------------------------------------------------------------- (a) Resolutions Parameters: p Name Min Value Max Fit? Prior Type mu sigma _ __________________ ____ _____ ____ _____ __________ __ _____ 1 "Resolution par 1" 0.01 0.03 0.05 false "uniform" 0 Inf (b) Resolutions: p Name Type Source Value 1 Value 2 Value 3 Value 4 Value 5 _ ______________ __________ __________________ _______ _______ _______ _______ _______ 1 "Resolution 1" "constant" "Resolution par 1" "" "" "" "" "" Layers: -------------------------------------------------------------------------------------------------- p Name Thickness SLD Roughness Hydration Hydrate with _ _______________ _____________________ ___________________ _____________________ _____________________ ____________ 1 "Oxide" "Oxide thick" "Oxide SLD" "Substrate Roughness" "Oxide Hydration" "bulk out" 2 "Sam tails" "Sam tails thick" "Sam tails SLD" "Sam rough" "Sam tails hydration" "bulk out" 3 "Sam heads" "SAM head thick" "SAM head SLD" "Sam rough" "SAM head hydration" "bulk out" 4 "Central water" "cw thick" "cw SLD" "Bilayer rough" "cw hydration" "bulk out" 5 "Bilayer heads" "Bilayer head thick" "Bilayer head SLD" "Bilayer rough" "Bilayer heads hydr" "bulk out" 6 "Bilayer tails" "Bilayer tails thick" "Bilayer tails SLD" "Bilayer rough" "Bilayer tails hydr" "bulk out" Custom Files: ------------------------------------------------------------------------------------------------------ Name Filename Function Name Language Path ____ ________ _____________ ________ ____ "" "" "" "" "" Data: ------------------------------------------------------------------------------------------------------ Name Data Data Range Simulation Range ______________ ______________________ _____________________ _____________________ "Simulation" "No Data" "-" "[ 0.0050 , 0.7000 ]" "dspc_bil_d2O" "Data array: [82 x 3]" "[ 0.0114 , 0.5934 ]" "[ 0.0114 , 0.5934 ]" "dspc_bil_smw" "Data array: [82 x 3]" "[ 0.0114 , 0.5934 ]" "[ 0.0114 , 0.5934 ]" Contrasts: ----------------------------------------------------------------------------------------------- p 1 2 ___________________ ________________ ________________ "Name" "D2O" "SMW" "Data" "dspc_bil_d2O" "dspc_bil_smw" "Background" "D2O Background" "SMW Background" "Background Action" "add" "add" "Bulk in" "Silicon" "Silicon" "Bulk out" "D2O" "SMW" "Scalefactor" "Scalefactor 1" "Scalefactor 2" "Resolution" "Resolution 1" "Resolution 1" "Resample" "false" "false" "Model" "Oxide" "Oxide" "" "Sam tails" "Sam tails" "" "Sam heads" "Sam heads" "" "Central water" "Central water" "" "Bilayer heads" "Bilayer heads" "" "Bilayer tails" "Bilayer tails" "" "Bilayer tails" "Bilayer tails" "" "Bilayer heads" "Bilayer heads"
results = struct with fields:
reflectivity: {2x1 cell} simulation: {2x1 cell} shiftedData: {2x1 cell} backgrounds: {2x1 cell} resolutions: {2x1 cell} sldProfiles: {2x1 cell} layers: {2x1 cell} resampledLayers: {2x1 cell} calculationResults: [1x1 struct] contrastParams: [1x1 struct] fitParams: [4.4869 18.9135 22.7873 10.4810 4.4106 18.0488 9.9354 28.3488 9.8557 6.6472 17.7437 16.6105 30.5795 21.7025 2.3318e-06 2.9295e-06 0.1036 0.1035 5.9697e-06 2.1642e-06] fitNames: {20x1 cell} predictionIntervals: [1x1 struct] confidenceIntervals: [1x1 struct] dreamParams: [1x1 struct] dreamOutput: [1x1 struct] nestedSamplerOutput: [1x1 struct] chain: [15010x20 double]
Finally, plot out what we have....
h1 = figure;
bayesShadedPlot(problem,results,'KeepAxes',true,'interval',65,'q4',false);
 
h3 = figure;
plotHists(results,'figure',h3,'smooth',true);
 
figure
plotChain(results);
 
h4 = figure; % Need a figure handle....
cornerPlot(results,'figure',h4,'smooth',false);