The SUMO toolbox  2018a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
Model Class Reference

Constructs an abstract Model object. More...

Inheritance diagram for Model:
Inheritance graph
[legend]

Public Member Functions

function getNestedModel ()
 
function Model (var varargin)
 
function basicPlotModel ()
 This is a basic/default implementation called by plotModel.m, if subclasses want more fancy features they should override plotModel and not basicPlotModel. More...
 
function init (var samples, var values)
 This base class method simply sets all the necessary fields (dimension, samples, values, id, ...) More...
 
function construct (var samples, var values)
 Constructs the model given the samples and values in simulator space. More...
 
function update (var samples, var values)
 Update the model with new data without fully retraining the model. More...
 
function getDimensions ()
 Return the input and output dimensions of the model. More...
 
function getExpression (var outputIndex)
 This function first converts the inputs to model space [-1,1] range using the transformation functions and then passes on these functions to the model-space expression. More...
 
function getId ()
 Returns the id of this model. More...
 
function getGrid ()
 Returns a set of samples evaluated on a dense grid to be used for evaluation of the model. More...
 
function equals (var m, var threshold)
 A grid based equality method. More...
 
function evaluate (var points)
 Evaluation at a set of points. More...
 
function evaluateDerivative (var points, var outputIndex)
 Approximate the derivative at the given points in simulator space. More...
 
function evaluateBatch (var points, var batchSize)
 Evaluate a large set of samples in smaller batchs. More...
 
function evaluateInModelSpaceBatch (var points, var batchSize)
 Evaluate a large set of samples in smaller batchs. More...
 
function setTransformationValues (var transf)
 Set the simulator to model and model to simulator transformation functions for this model. More...
 
function getTransformationFunctions ()
 Get the simulator to model and model to simulator transformation functions for this model. More...
 
function getTransformationValues ()
 
function setMeasureScores (var scores)
 Sets scores of this model. More...
 
function getMeasureScores ()
 Returns the structure containing the detailed measure scores for each output. More...
 
function getSamples ()
 Returns the set of samples (in simulator space) on which this model was built. More...
 
function getSamplesInModelSpace ()
 Returns the set of samples on which this model was built (in model space! so in [-1 1]) More...
 
function getValues ()
 Returns the set of values in the samples on which this model was built. More...
 
function setScore (var score)
 Set the global score for this model. More...
 
function getScore ()
 Return the global score of the model. More...
 
function getBounds ()
 Return the lower and upper bounds (in the original simulator space) of each model input. More...
 
function getInputNames ()
 Get the names of the input parameters. More...
 
function getOutputNames ()
 Get the names of the output parameters. More...
 
function setMode (var mode)
 
function getMode ()
 
function setTrainingTime (var trainingTime)
 
function getTrainingTime ()
 
function getType ()
 
function getVersionId ()
 
function display ()
 
function plotModel ()
 Plots the model on the given domain (default: [-1 1]). More...
 
function plotSobolIndices (var varargin)
 Plots the first order total Sobol indices in a pie chart. More...
 
function constructInModelSpace (var samples, var values)
 Base class method, simply calles init() to set the necessary fields, there is no model to train. More...
 
function complexity ()
 Returns the number of free variables in the model. More...
 
function getExpressionInModelSpace (var outputIndex)
 Override if the model can generate a symbolic expression. More...
 
function evaluateDerivativeInModelSpace (var points, var outputIndex)
 Approximate the derivative at the given points in model space. More...
 
function updateInModelSpace (var samples, var values)
 Update the model with new data without fully retraining the model. More...
 
function getSensitivityIndices (var order, var type, var method)
 
function setInputNames (var names)
 Set the names of the input parameters. More...
 
function setOutputNames (var names)
 Set the names of the output parameters. More...
 
function getDescription ()
 
function evaluateInModelSpace (var points)
 

Static Public Member Functions

static function getPlotDefaults ()
 
static function loadobj (var this)
 

Detailed Description

Constructs an abstract Model object.

Constructor & Destructor Documentation

function Model ( var  varargin)
inline

Member Function Documentation

function basicPlotModel ( )

This is a basic/default implementation called by plotModel.m, if subclasses want more fancy features they should override plotModel and not basicPlotModel.

Todo:
not sure why this would be needed
function complexity ( )

Returns the number of free variables in the model.

By default this is the number of samples.

function construct ( var  samples,
var  values 
)

Constructs the model given the samples and values in simulator space.

This function scales the data to model space and calls constructInModelSpace()

function constructInModelSpace ( var  samples,
var  values 
)

Base class method, simply calles init() to set the necessary fields, there is no model to train.

function display ( )
inline
function equals ( var  m,
var  threshold 
)

A grid based equality method.

Evaluates 'm' and 'this' on a grid and returns true if the mean relative error is <= threshold

function evaluate ( var  points)

Evaluation at a set of points.

function evaluateBatch ( var  points,
var  batchSize 
)

Evaluate a large set of samples in smaller batchs.

Todo:
some duplicate code, see evaluateInModelSpaceBatch
function evaluateDerivative ( var  points,
var  outputIndex 
)

Approximate the derivative at the given points in simulator space.

This function transforms the points to model space and calls evaluateDerivativeInModelSpace

function evaluateDerivativeInModelSpace ( var  points,
var  outputIndex 
)

Approximate the derivative at the given points in model space.

It will return the gradient in each dimension. This is just a very simple implementation based on a simple symmetric approximation. Note that models can override this with more efficient implementations. For example Rational/Polynomial models would be able to provide exact derivatives. The same goes for Kriging models.

For a good tutorial/intro on gradients see: http://www-math.mit.edu/18.013A/HTML/chapter07/contents.html

function evaluateInModelSpace ( var  points)
function evaluateInModelSpaceBatch ( var  points,
var  batchSize 
)

Evaluate a large set of samples in smaller batchs.

function getBounds ( )

Return the lower and upper bounds (in the original simulator space) of each model input.

function getDescription ( )
inline
function getDimensions ( )

Return the input and output dimensions of the model.

function getExpression ( var  outputIndex)

This function first converts the inputs to model space [-1,1] range using the transformation functions and then passes on these functions to the model-space expression.

function getExpressionInModelSpace ( var  outputIndex)

Override if the model can generate a symbolic expression.

function getGrid ( )

Returns a set of samples evaluated on a dense grid to be used for evaluation of the model.

Recycles previously evaluated grids.

function getId ( )

Returns the id of this model.

Id's are defined in the construct function, so that a model that is reconstructed gets a new unique id.

function getInputNames ( )

Get the names of the input parameters.

function getMeasureScores ( )

Returns the structure containing the detailed measure scores for each output.

function getMode ( )
inline
function getNestedModel ( )
inline
function getOutputNames ( )

Get the names of the output parameters.

static function getPlotDefaults ( )
inlinestatic
function getSamples ( )

Returns the set of samples (in simulator space) on which this model was built.

function getSamplesInModelSpace ( )

Returns the set of samples on which this model was built (in model space! so in [-1 1])

function getScore ( )

Return the global score of the model.

function getSensitivityIndices ( var  order,
var  type,
var  method 
)
function getTrainingTime ( )
inline
function getTransformationFunctions ( )

Get the simulator to model and model to simulator transformation functions for this model.

Return values
inFuncsimulator -> model space
outFuncmodel -> simulator space
function getTransformationValues ( )
inline
function getType ( )
inline
function getValues ( )

Returns the set of values in the samples on which this model was built.

function getVersionId ( )
inline
function init ( var  samples,
var  values 
)

This base class method simply sets all the necessary fields (dimension, samples, values, id, ...)

static function loadobj ( var  this)
inlinestatic
function plotModel ( )

Plots the model on the given domain (default: [-1 1]).

Slice plots are made for dimensions larger than 2. Dimensions higher than 5 are clamped to 0. Subclasses may override this method if they wish to allow for model specific plotting. This implementation simply calls basicPlotModel. The default plot options can be found by calling the static member function getPlotDefaults().

Calling syntax: fighandle = plotModel(model,[output number],[options structure])

function plotSobolIndices ( var  varargin)

Plots the first order total Sobol indices in a pie chart.

function setInputNames ( var  names)

Set the names of the input parameters.

function setMeasureScores ( var  scores)

Sets scores of this model.

function setMode ( var  mode)
inline
function setOutputNames ( var  names)

Set the names of the output parameters.

function setScore ( var  score)

Set the global score for this model.

function setTrainingTime ( var  trainingTime)
inline
function setTransformationValues ( var  transf)

Set the simulator to model and model to simulator transformation functions for this model.

function update ( var  samples,
var  values 
)

Update the model with new data without fully retraining the model.

This is useful for model types that support on-line learning This base class implementation simply calls construct. It is up to the model type to give a more efficient implementation

function updateInModelSpace ( var  samples,
var  values 
)

Update the model with new data without fully retraining the model.

This is useful for model types that support on-line learning This base class implementation simply calls constructInModelSpace. It is up to the model type to give a more efficient implementation


The documentation for this class was generated from the following files: