주요 콘텐츠

fitmbcmodel

R2026b

Fit model to new or existing data and provide summary statistics

Since R2026b

    Description

    [mdl,stats] = fitmbcmodel(X,Y) fits a Gaussian process model to the input data X and response data Y. The function uses the data to determine the input ranges of the model.

    example

    [mdl,stats] = fitmbcmodel(X,Y,Type) specifies the model type to fit.

    example

    [mdl,stats] = fitmbcmodel(X,Y,Type,Name=Value) specifies additional model properties using one or more name-value arguments.

    example

    Examples

    collapse all

    Create sample input and response data, and then fit a Gaussian Process Model.

    X = linspace(0,10,50)';
    Y = sin(X) + 0.1*randn(size(X));
    [mdl,stats] = fitmbcmodel(X,Y)

    Fit a polynomial model to multivariate data by specifying Type as "Polynomial".

    X = rand(100,2);
    Y = X(:,1).^2 + 2*X(:,2) + randn(100,1)*0.1;
    [mdl,stats] = fitmbcmodel(X,Y,"Polynomial")

    If you pass a table for the input data, the fitmbcmodel function uses the variable names as model input names.

    Create a table of input data and fit a radial basis function ("RBF") model.

    Speed = linspace(1000,6000,50)';
    Load = linspace(10,100,50)';
    X = table(Speed,Load);
    Y = 0.5*Speed + 0.3*Load + randn(50,1)*10;
    [mdl,stats] = fitmbcmodel(X,Y,"RBF")

    To evaluate predictions at new input points, fit a model, and then use the fitted model object.

    X = rand(100,2)*10;
    Y = X(:,1).^2 + 3*X(:,2) + randn(100,1)*0.5;
    mdl = fitmbcmodel(X,Y);
    Xnew = rand(20,2)*10;
    Ypred = Evaluate(mdl,Xnew)

    Input Arguments

    collapse all

    Input data, specified as a numeric matrix or a table. Each column corresponds to one input variable, and each row corresponds to one observation. If X is a table, the variable names are used as model input names. If X is a numeric matrix, the function generates anonymous input names based on the number of columns.

    Data Types: double | table

    Response data, specified as a numeric vector or a table. Y must have the same number of rows as X.

    Data Types: double | table

    Model type to fit, specified as a string scalar or character vector. The function ignores spaces in values for this argument, and values are case insensitive. The default value is "GPM", which creates a Gaussian process model. The short form "GPM" is equivalent to "Gaussian Process Model".

    These are the model types available:

    • "GPM"

    • "Gaussian Process Model"

    • "Polynomial"

    • "Hybrid Spline"

    • "RBF"

    • "Radial Basis Function"

    • "Hybrid RBF"

    • "Polynomial-RBF"

    • "HybridSpline-RBF"

    • "FreeKnotSpline"

    • "User-Defined"

    • "Transient"

    • "NeuralNetwork"

    • "InterpolatingRBF"

    • "LocalPolynomialSpline"

    • "LocalPolynomialwithDatum"

    • "LocalPolynomial"

    • "LocalHybridSpline"

    • "LocalTruncatedPowerSeries"

    • "LocalFreeKnotSpline"

    • "LocalGrowth"

    • "LocalUser-Defined"

    • "LocalTransient"

    • "LocalAverageFit"

    • "Point-by-Point"

    Note

    All Local model types in this list require a single input variable. For these model types, X must be a column vector.

    Data Types: string | char

    Output Arguments

    collapse all

    Fitted model, returned as an mbcmodel.model object. The model contains the fitted parameters and input definitions with ranges determined from the data.

    Fit statistics, returned as a structure containing diagnostic information about the model fit.

    Version History

    Introduced in R2026b