Difference between revisions of "Add Measure"

From SUMOwiki
Jump to navigationJump to search
Line 3: Line 3:
 
You are free to implement your own [[Measures|measures]] and add them to the toolbox.  For example, this could be useful if you want to enforce a problem specific property.  Say you are modeling a passive electronic component and you want to ensure the model retains passivity.  This can be done by implementing a custom measure that performs the necessary checks.
 
You are free to implement your own [[Measures|measures]] and add them to the toolbox.  For example, this could be useful if you want to enforce a problem specific property.  Say you are modeling a passive electronic component and you want to ensure the model retains passivity.  This can be done by implementing a custom measure that performs the necessary checks.
  
Implementing a new measure requires the following (see src/matlab/modelbuilders/measures):
+
To implement a new measure we suggest the following:
* a constructor to read out the configuration objects
+
 
* a calculateMeasure method that, given a model, returns a positive score where a lower score indicates a better model
+
* Go to the src/matlab/measures subdirectory and take a look at the most simple measure: SampleError
 +
* Make a copy of the SampleError directory and give it the same of your Measure
 +
* There are two methods you should provide:
 +
** a constructor to read out the configuration information (if any) and construct the object
 +
** a calculateMeasure method that, given a model, returns a positive score where a lower score indicates a better model
 +
 
 +
Before starting ensure you are familiar with [[OO_Programming_in_Matlab]].

Revision as of 16:05, 26 March 2009

In order for a modeling algorithm to work some kind of measure is needed that scores models and guides the search towards a good local optimum. A model can be scored in many different ways: using a separate validation set, simply the error in the fitted samples, cross validation, minimum description length (MDL), etc.

You are free to implement your own measures and add them to the toolbox. For example, this could be useful if you want to enforce a problem specific property. Say you are modeling a passive electronic component and you want to ensure the model retains passivity. This can be done by implementing a custom measure that performs the necessary checks.

To implement a new measure we suggest the following:

  • Go to the src/matlab/measures subdirectory and take a look at the most simple measure: SampleError
  • Make a copy of the SampleError directory and give it the same of your Measure
  • There are two methods you should provide:
    • a constructor to read out the configuration information (if any) and construct the object
    • a calculateMeasure method that, given a model, returns a positive score where a lower score indicates a better model

Before starting ensure you are familiar with OO_Programming_in_Matlab.