主要内容

CreateAlgorithm

Create algorithm

    Description

    NewAlg = CreateAlgorithm(Alg,AlgorithmName) creates an algorithm of the specified type.

    example

    Examples

    collapse all

    Change the fit algorithm for a model.

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

    AlgorithmName determines what properties you can set. Display the properties for an algorithm.

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

    Input Arguments

    collapse all

    Algorithm, specified as a mbcmodel.fitalgorithm object.

    Algorithm name, specified as a character vector. AlgorithmName must be in the list of alternative algorithms given by getAlternativeNames.

    Output Arguments

    collapse all

    New algorithm, specified as a character vector.

    Algorithms

    collapse all

    AlgorithmName determines what properties you can set.

    Version History

    Introduced in R2007a