Products & Services Solutions Academia Support User Community Company

Learn more about Model-Based Calibration   

CreateAlgorithm - Create algorithm

Syntax

newalg = alg.CreateAlgorithm( AlgorithmName)

Description

This is a method of mbcmodel.fitalgorithm.

newalg = alg.CreateAlgorithm( AlgorithmName) creates an algorithm of the specified type. alg is a mbcmodel.fitalgorithm object. AlgorithmName must be in the list of alternative algorithms given by alg.getAlternativeNames.

To change the fit algorithm for a model:

>> mdl = mbcmodel.CreateModel('Polynomial', 2);
>> minpress = mdl.FitAlgorithm.CreateAlgorithm('Minimize PRESS');
>> mdl.FitAlgorithm = minpress;

The AlgorithmName determines what properties you can set. You can display the properties for an algorithm as follows:

>> mdl.FitAlgorithm.properties

Algorithm: Minimize PRESS
Alternatives: 'Least Squares','Forward Selection','Backward 
Selection','Prune'
     MaxIter: Maximum Iterations (int: [1,1000])

As a simpler alternative to using CreateAlgorithm, you can assign the algorithm name directly to the algorithm. For example:

B.FitAlgorithm.BoundaryPointOptions = 'Boundary Only';

Or:

m.FitAlgorithm = ‘Minimize PRESS';

Case and spaces are ignored. See FitAlgorithm.

The following sections list the properties available for each algorithm type.

Linear Model Algorithm Properties

Linear Models Algorithms

Used by polynomials, hybrid splines and as the StepAlgorithm for RBF algorithms.

Algorithm: Least Squares

Alternatives: 'Minimize PRESS','Forward Selection','Backward Selection','Prune'

Algorithm: Minimize PRESS

Alternatives: 'Least Squares','Forward Selection','Backward Selection','Prune'

Algorithm: Forward Selection

Alternatives: 'Least Squares','Minimize PRESS','Backward Selection','Prune'

Algorithm: Backward Selection

Alternatives: 'Least Squares','Minimize PRESS','Forward Selection','Prune'

Algorithm: Prune

Alternatives: 'Least Squares','Minimize PRESS','Forward Selection','Backward Selection'

RBF Algorithm Properties

For information about any of the RBF and Hybrid RBF algorithm properties, see Radial Basis Functions, and especially Fitting Routines in the Model Browser User's Guide.

Algorithm: RBF Fit

Width Selection Algorithms

Alternatives: 'WidPerDim','Tree Regression'

Algorithm: TrialWidths

Algorithm: WidPerDim

Alternatives: 'TrialWidths','Tree Regression'

Algorithm: Tree Regression

Alternatives: 'TrialWidths','WidPerDim'

Lambda Selection Algorithms

Algorithm: IterateRidge

Alternatives: 'IterateRols','StepItRols'

Algorithm: IterateRols

Alternatives: 'IterateRidge','StepItRols'

Algorithm: StepItRols

Alternatives: 'IterateRidge','IterateRols'

Center Selection Algorithms

Algorithm: Rols

Alternatives: 'RedErr','WiggleCenters','CenterExchange'

Algorithm: RedErr

Alternatives: 'Rols','WiggleCenters','CenterExchange'

Algorithm: WiggleCenters

Alternatives: 'Rols','RedErr','CenterExchange'

Algorithm: CenterExchange

Alternatives: 'Rols','RedErr','WiggleCenters'

Tree Regression Algorithms

Algorithm: Trial Alpha

Alternatives: 'Specify Alpha'

Algorithm: Specify Alpha

Alternatives: 'Trial Alpha'

Algorithm: Tree-based Center Selection

Alternatives: 'Generic Center Selection'

Algorithm: Generic Center Selection

Alternatives: 'Tree-based Center Selection'

Hybrid RBF Algorithms

Algorithm: RBF Fit

Width Selection Algorithms

Algorithm: TrialWidths

Nested Fit Algorithms

Algorithm: Twostep

Alternatives: 'Interlace'

Algorithm: Interlace

Alternatives: 'Twostep'

Boundary Model Fit Algorithm Parameters

The following sections list the available fit algorithm parameters for command-line boundary models. The boundary model fit algorithm parameters have the same fit options as the Boundary Editor GUI. For instructions on using these fit options, see Boundary Model Fit Options in the Model Browser documentation.

Ellipsoid

Algorithm: Constraint Fitting

BoundaryPointOptions: Boundary Points (mbcmodel.fitalgorithm)

The boundary points algorithm uses optimization to find the best ellipse. These options are from fmincon.

Algorithm: Boundary Points

Star-shaped

Algorithm: Constraint Fitting

SpecialPointOptions: Special Points (mbcmodel.fitalgorithm)

BoundaryPointOptions: Boundary Points (mbcmodel.fitalgorithm)

ConstraintFitOptions: Constraint Fit (mbcmodel.fitalgorithm)

Star-shaped—Special Points

Algorithm: Star-shaped Points

CenterAlg: Center (mbcmodel.fitalgorithm)

Algorithm alternatives: 'Mean', 'Median', 'Mid Range', 'Min Ellipse', 'User Defined'

For User Defined only: CenterPoint: User-defined center [X1,X2] (vector: NumberOfActiveInputs)

Star-shaped—Boundary Points

You can choose to find boundary points (use Interior) or to assume that all points are on the boundary (use Boundary Only). The interior algorithm then has manual and auto options for the dilation radius and ray casting algorithms.

Star-shaped—Constraint Fit

Algorithm: Star-shaped RBF Fit

Further options:

Examples

First get a fitalgorithm object, F, from a model:

M = mbcmodel.CreateModel('Polynomial', 4);
F = M.FitAlgorithm
 
F = 
Algorithm: Least Squares
Alternatives: 'Minimize PRESS','Forward Selection','Backward 
Selection','Prune'
1x1 struct array with no fields.

Then, to create a new algorithm type:

Alg = CreateAlgorithm(F, 'Minimize PRESS')
 
Alg = 
Algorithm: Minimize PRESS
Alternatives: 'Least Squares','Forward Selection','Backward 
Selection','Prune'
    MaxIter: 50

The AlgorithmName determines what properties you can set. You can display the properties for an algorithm as follows:

>> mdl.FitAlgorithm.properties

Algorithm: Minimize PRESS
Alternatives: 'Least Squares','Forward Selection','Backward 
Selection','Prune'
     MaxIter: Maximum Iterations (int: [1,1000])

As a simpler alternative to using CreateAlgorithm, you can assign the algorithm name directly to the algorithm. For example:

B.FitAlgorithm.BoundaryPointOptions = 'Boundary Only';

Or:

m.FitAlgorithm = ‘Minimize PRESS';

Case and spaces are ignored.

See Also

getAlternativeNames, SetupDialog, FitAlgorithm

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS