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
RationalModel Class Reference

Construct a `RationalModel' object. More...

Inheritance diagram for RationalModel:
Inheritance graph
[legend]

Public Member Functions

function RationalModel (var varargin)
 
function constructInModelSpace (var samples, var values)
 Build a rational model through the samples and values Model parameters are: More...
 
function evaluateInModelSpace (var points)
 Evaluate discrete points, given by the M times dim array points. More...
 
function getDescription ()
 Return a user friendly description of the model. More...
 
function getExpressionInModelSpace (var outputIndex)
 Returns the closed formula (as a string) for this rational function. More...
 
function getNestedModel ()
 
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 complexity ()
 Returns the number of free variables in the model. 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...
 

Static Public Member Functions

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

Detailed Description

Construct a `RationalModel' object.

A rational object can be used to interpolate sample/value pairs. It is created using a `degrees' object and a percentage that states the ratio of degrees of freedom in the interpolation system over the number of samples. So 100% means interpolation, anything smaller will lead to least-squares approximation. A copy constructor and a constructor from a structure created by the `makestorestruct' method are also available.

Constructor & Destructor Documentation

function RationalModel ( var  varargin)
inline

Member Function Documentation

function basicPlotModel ( )
inherited

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 ( )
inherited

Returns the number of free variables in the model.

By default this is the number of samples.

function construct ( var  samples,
var  values 
)
inherited

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 
)

Build a rational model through the samples and values Model parameters are:

  • percentage : number of free variables as a percentage of the number of sample points
  • degrees : a structure returning the order in which degrees of freedom are selected
  • frequencyVariable : a special input which is treated as complex frequency, models are built slightly different in order to obtain real coefficients.
function display ( )
inlineinherited
function equals ( var  m,
var  threshold 
)
inherited

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)
inherited

Evaluation at a set of points.

function evaluateBatch ( var  points,
var  batchSize 
)
inherited

Evaluate a large set of samples in smaller batchs.

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

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 
)
inherited

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)

Evaluate discrete points, given by the M times dim array points.

function evaluateInModelSpaceBatch ( var  points,
var  batchSize 
)
inherited

Evaluate a large set of samples in smaller batchs.

function getBounds ( )
inherited

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

function getDescription ( )

Return a user friendly description of the model.

function getDimensions ( )
inherited

Return the input and output dimensions of the model.

function getExpression ( var  outputIndex)
inherited

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)

Returns the closed formula (as a string) for this rational function.

function getGrid ( )
inherited

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

Recycles previously evaluated grids.

function getId ( )
inherited

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 ( )
inherited

Get the names of the input parameters.

function getMeasureScores ( )
inherited

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

function getMode ( )
inlineinherited
function getNestedModel ( )
inlineinherited
function getOutputNames ( )
inherited

Get the names of the output parameters.

static function getPlotDefaults ( )
inlinestaticinherited
function getSamples ( )
inherited

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

function getSamplesInModelSpace ( )
inherited

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

function getScore ( )
inherited

Return the global score of the model.

function getSensitivityIndices ( var  order,
var  type,
var  method 
)
inherited
function getTrainingTime ( )
inlineinherited
function getTransformationFunctions ( )
inherited

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

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

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

function getVersionId ( )
inlineinherited
function init ( var  samples,
var  values 
)
inherited

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

static function loadobj ( var  this)
inlinestaticinherited
function plotModel ( )
inherited

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)
inherited

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

function setInputNames ( var  names)
inherited

Set the names of the input parameters.

function setMeasureScores ( var  scores)
inherited

Sets scores of this model.

function setMode ( var  mode)
inlineinherited
function setOutputNames ( var  names)
inherited

Set the names of the output parameters.

function setScore ( var  score)
inherited

Set the global score for this model.

function setTrainingTime ( var  trainingTime)
inlineinherited
function setTransformationValues ( var  transf)
inherited

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

function update ( var  samples,
var  values 
)
inherited

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 
)
inherited

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: