MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES Guide de l'utilisateur

Naviguer en ligne ou télécharger Guide de l'utilisateur pour Logiciel MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES. MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES User`s guide Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 216
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 1 - Curve Fitting

ComputationVisualizationProgrammingFor Use with MATLAB®User’s GuideVersion 1Curve FittingToolbox

Page 2 - How to Contact The MathWorks:

Preface viiiRelated ProductsThe Curve Fitting Toolbox requires MATLAB 6.5 (Release 13). Additionally, The MathWorks provides several related products

Page 3 - Contents

3 Fitting Data3-24Fitting Method and Algorithm• Method — The fitting method.The method is automatically selected based on the library or custom model

Page 4

Parametric Fitting3-25• TolFun — Termination tolerance used on stopping conditions involving the function (model) value. The default value is 10-6.•To

Page 5

3 Fitting Data3-26Default Coefficient ParametersThe default coefficient starting points and constraints for library and custom models are given below.

Page 6

Parametric Fitting3-27Evaluating the Goodness of FitAfter fitting data with one or more models, you should evaluate the goodness of fit. A visual exam

Page 7

3 Fitting Data3-28Mathematically, the residual for a specific predictor value is the difference between the response value y and the predicted respons

Page 8

Parametric Fitting3-29A graphical display of the residuals for a second-degree polynomial fit is shown below. The model includes only the quadratic te

Page 9

3 Fitting Data3-30For the current fit, these statistics are displayed in the Results list box in the Fit Editor. For all fits in the current curve-fit

Page 10 - Related Products

Parametric Fitting3-31If you increase the number of fitted coefficients in your model, R-square might increase although the fit may not improve. To av

Page 11 - Using This Guide

3 Fitting Data3-32Confidence and Prediction BoundsWith the Curve Fitting Toolbox, you can calculate confidence bounds for the fitted coefficients, and

Page 12

Parametric Fitting3-33Calculating and Displaying Confidence Bounds. The confidence bounds for fitted coefficients are given bywhere b are the coeffici

Page 13 - Installation Information

Using This Guide ixUsing This GuideExpected BackgroundThis guide assumes that you already have background knowledge in the subject of curve fitting da

Page 14 - Typographical Conventions

3 Fitting Data3-34The nonsimultaneous prediction bounds for a new observation at the predictor value x are given bywhere s2 is the mean squared error,

Page 15 - Curve Fitting Toolbox

Parametric Fitting3-35To understand the quantities associated with each type of prediction interval, recall that the data, fit, and residuals (random

Page 16

3 Fitting Data3-36are wider than the fitted function intervals because of the additional uncertainty in predicting a new response value (the fit plus

Page 17 - Importing the Data

Parametric Fitting3-37Example: Evaluating the Goodness of FitThis example fits several polynomial models to generated data and evaluates the goodness

Page 18 - Create data set

3 Fitting Data3-38The numerical fit results are shown below.As expected, the fit results for poly3 are reasonable because the generated data is cubic.

Page 19 - Fitting the Data

Parametric Fitting3-39The 95% nonsimultaneous prediction bounds for new observations are shown below. To display prediction bounds in the Curve Fittin

Page 20 - Copy Fit

3 Fitting Data3-40Therefore, you would conclude that more data must be collected before you can make accurate predictions using a fifth-degree polynom

Page 21

Parametric Fitting3-41Example: Rational FitThis example fits measured data using a rational model. The data describes the coefficient of thermal expan

Page 22 - Determining the Best Fit

3 Fitting Data3-42As you can see by examining the shape of the data, a reasonable initial choice for the rational model is quadratic/quadratic. The Fi

Page 23

Parametric Fitting3-43The data, fit, and residuals are shown below. The fit clearly misses the data for the smallest and largest predictor values. Add

Page 24 - Tools->Axes Limit Control

Preface xDocumentation Examples and Data SetsTo learn how to use the Curve Fitting Toolbox, you can follow the examples included in this guide. A qui

Page 25 - Table of Fits

3 Fitting Data3-44For the next fit, try a cubic/cubic equation. The data, fit, and residuals are shown below.The numerical results shown below indicat

Page 26

Parametric Fitting3-45Although the message in the Results window indicates that you might improve the fit if you increase the maximum number of iterat

Page 27 - Saving the Fit Results

3 Fitting Data3-46Example: Fitting with Custom EquationsYou can define your own equations with the Create Custom Equation GUI. You open this GUI one o

Page 28

Parametric Fitting3-47It is sometimes useful to describe a variable expressed as a function of angle in terms of Legendre polynomialswhere Pn(x) is a

Page 29 - Analyzing the Fit

3 Fitting Data3-48The first step is to load the 12C alpha-emission data from the file carbon12alpha.mat, which is provided with the toolbox. load carb

Page 30 - Saving the Analysis Results

Parametric Fitting3-49Fit the data using a fourth-degree Legendre polynomial with only even terms:Because the Legendre polynomials depend only on the

Page 31 - Saving Your Work

3 Fitting Data3-50The fit and residuals are shown below. The fit appears to follow the trend of the data well, while the residuals appear to be random

Page 32 - Saving the Session

Parametric Fitting3-51To confirm the theoretical argument that the alpha-emission data is best described by a fourth-degree Legendre polynomial with o

Page 33 - Generating an M-File

3 Fitting Data3-52General Equation: Fourier Series FitThis example fits the ENSO data using several custom nonlinear equations. The ENSO data consists

Page 34

Parametric Fitting3-53Note that the toolbox includes the Fourier series as a nonlinear library equation. However, the library equation does not meet t

Page 35 - Preprocessing Data

Installation Information xiInstallation InformationTo determine if the Curve Fitting Toolbox is installed on your system, typeverat the MATLAB prompt.

Page 36 - Importing Data Sets

3 Fitting Data3-54The fit, residuals, and numerical results are shown below. The fit appears to be reasonable for some of the data points but clearly

Page 37 - Data Sets List

Parametric Fitting3-55The fit, residuals, and numerical results are shown below. The fit appears to be reasonable for most of the data points. However

Page 38 - Data Import Process

3 Fitting Data3-56The fit, residuals, and numerical results are shown below. The fit is an improvement over the previous two fits, and appears to acco

Page 39 - Create data set button

Parametric Fitting3-57General Equation: Gaussian Fit with Exponential BackgroundThis example fits two poorly resolved Gaussian peaks on a decaying exp

Page 40 - Viewing Data

3 Fitting Data3-58The data, fit, and numerical fit results are shown below. Clearly, the fit is poor. Because the starting points are randomly selecte

Page 41

Parametric Fitting3-59The results include this warning message.Fit computation did not converge:Maximum number of function evaluations exceeded. Incre

Page 42 - Viewing Data Numerically

3 Fitting Data3-60The data, fit, residuals, and numerical results are shown below.

Page 43 - Smoothing Data

Parametric Fitting3-61Example: Robust FitThis example fits data that is assumed to contain one outlier. The data consists of the 2000 United States pr

Page 44 - Smoothing method

3 Fitting Data3-62To create a first-degree polynomial equation with zero offset, you must create a custom linear equation. As described in “Example: F

Page 45 - Data Sets

Parametric Fitting3-63The Exclude GUI is shown below. The exclusion rule is named AbsenteeVotes. You use the Fitting GUI to associate an exclusion rul

Page 46 - Moving Average Filtering

Preface xiiTypographical ConventionsThis guide uses some or all of these conventions.Item Convention ExampleExample code Monospace font To assign the

Page 47

3 Fitting Data3-64The Fit Editor and the Fit Options GUI are shown below for a robust fit. The data, robust and regular least squares fits, and residu

Page 48

Parametric Fitting3-65The graphical results show that the linear model is reasonable for the majority of data points, and the residuals appear to be r

Page 49

3 Fitting Data3-66Again, the graphical results show that the linear model is reasonable for the majority of data points, and the residuals appear to b

Page 50 - Lowess Smoothing

Parametric Fitting3-67The margin of victory for George Bush is given bymargin = sum(bush)–sum(gore)margin = 537Therefore, the voter intention comes

Page 51 - Robust Smoothing Procedure

3 Fitting Data3-68Nonparametric FittingIn some cases, you are not concerned about extracting or interpreting fitted parameters. Instead, you might sim

Page 52 - Robust Lowess Smoothing

Nonparametric Fitting3-69The type of interpolant you should use depends on the characteristics of the data being fit, the required smoothness of the c

Page 53 - Savitzky-Golay Filtering

3 Fitting Data3-70Note Goodness of fit statistics, prediction bounds, and weights are not defined for interpolants. Additionally, the fit residuals a

Page 54 - Savitzky−Golay Smoothing

Nonparametric Fitting3-71parameter, you can consider these fits to be parametric. However, smoothing splines are also piecewise polynomials like cubic

Page 55 - Example: Smoothing Data

3 Fitting Data3-72Example: Nonparametric FitThis example fits the following data using a cubic spline interpolant and several smoothing splines.rand(&

Page 56 - View button

Nonparametric Fitting3-73As shown below, you can fit the data with a smoothing spline by selecting Smoothing Spline in the Type of fit list.The level

Page 57

1Getting Started with the Curve Fitting ToolboxThis chapter describes a particular example in detail to help you get started with the Curve Fitting T

Page 58 - Saving the Results

3 Fitting Data3-74The data and fits are shown below. The default abscissa scale was increased to show the fit behavior beyond the data limits. You cha

Page 59 - Excluding and Sectioning Data

Selected Bibliography3-75Selected Bibliography[1] Draper, N.R and H. Smith, Applied Regression Analysis, 3rd Ed., John Wiley & Sons, New York, 199

Page 60 - Exclusion Rule

3 Fitting Data3-76

Page 61 - Marking Outliers

4Function ReferenceThis chapter describes the toolbox M-file functions that you use directly. A number of other M-file helper functions are provided

Page 62

4 Function Reference4-78Functions – By CategoryFitting DataGetting Information and HelpGetting and Setting PropertiesPreprocessing Datacfit Create a c

Page 63 - Influential Data Points

Functions – By Category4-79Postprocessing DataGeneral Purposeconfint Compute confidence bounds for fitted coefficientsdifferentiate Differentiate a fi

Page 64 - Sectioning

4 Function Reference4-80Functions – Alphabetical ListThis section contains detailed descriptions of all toolbox functions. Each function reference pag

Page 65

cfit4-814cfitPurpose Create a cfit objectSyntax fmodel = cfit(ftype,coef1,coef2,...)ArgumentsDescriptionfmodel = cfit(ftype,coef1,coef2,...) creates t

Page 66 - Check to

cflibhelp4-824cflibhelpPurpose Display information about library models, splines, and interpolantsSyntax cflibhelpcflibhelp groupArgumentsDescriptionc

Page 67

cflibhelp4-83Example Display the names and descriptions for the spline fit type group.cflibhelp splineSPLINES SPLINETYPE DESCRIPTIO

Page 68 - Individual data points

1 Getting Started with the Curve Fitting Toolbox1-2Opening the Curve Fitting ToolThe Curve Fitting Tool is a graphical user interface (GUI) that allow

Page 69 - Viewing the Exclusion Rule

cftool4-844cftoolPurpose Open the Curve Fitting ToolSyntax cftoolcftool(xdata,ydata)ArgumentsDescriptioncftool opens the Curve Fitting Tool.cftool(xda

Page 70

cftool4-85The Curve Fitting Tool is shown below. The data is from the census MAT-file, and the fit is a quadratic polynomial. The residuals are shown

Page 71

cftool4-86The Data GUIThe Data GUI allows you to• Import, preview, name, and delete data sets• Smooth noisy dataThe Data GUI is shown below with the c

Page 72 - applied

cftool4-87The Fitting GUIThe Fitting GUI allows you to• Fit data using a parametric or nonparametric equation• Examine and compare fit results includi

Page 73

cftool4-88The Exclude GUIThe Exclude GUI allows you to create exclusion rules for a data set. An exclusion rule identifies data to be excluded while f

Page 74 - Infs, NaNs, and outliers

cftool4-89The Analysis GUIThe Analysis GUI allows you to• Evaluate (interpolate or extrapolate), differentiate, or integrate a fit• Plot the analysis

Page 75

confint4-904confintPurpose Compute confidence bounds for fitted coefficientsSyntax ci = confint(fresult)ci = confint(fresult,level)ArgumentsDescriptio

Page 76

confint4-91Example Fit the census data to a second-degree polynomial. The display for fresult includes the 95% confidence bounds for the fitted coeffi

Page 77

datastats4-924datastatsPurpose Return descriptive statistics about the dataSyntax xds = datastats(xdata)[xds,yds] = datastats(xdata,ydata)ArgumentsDes

Page 78 - The Fitting Process

datastats4-93Example Return data statistics for the census data.load census[xds,yds] = datastats(cdate,pop)xds = num: 21 max: 1990

Page 79 - 5 Save the fit results

Importing the Data1-3Importing the DataBefore you can import data into the Curve Fitting Tool, the data variables must exist in the MATLAB workspace.

Page 80

differentiate4-944differentiatePurpose Differentiate a fit result objectSyntax deriv1 = differentiate(fitresult,x)[deriv1,deriv2] = differentiate(...)

Page 81 - Constant Variance

differentiate4-95Example Create a noisy sine wave on the interval [0, 4π].rand('state',0);x = linspace(0,4*pi,200)';y = sin(x) + (rand(

Page 82 - Linear Least Squares

disp4-964dispPurpose Display descriptive information for Curve Fitting Toolbox objectsSyntax objdisp(obj)ArgumentsDescriptionobj or disp(obj) displays

Page 83

disp4-97Note that all fit types have the Normalize, Exclude, Weights, and Method fit options. Additional fit options are available depending on the Me

Page 84

excludedata4-984excludedataPurpose Specify data to be excluded from a fitSyntax outliers = excludedata(xdata,ydata,’MethodName’,MethodValue)ArgumentsD

Page 85 - Weighted Linear Least Squares

excludedata4-99Remarks You can combine data exclusion methods using logical operators. For example, to combine methods using the | (OR) operatoroutlie

Page 86

feval4-1004fevalPurpose Evaluate a fit result object or a fit type objectSyntax f = feval(fresult,x)f = feval(ftype,coef1,coef2,...,x)ArgumentsDescrip

Page 87 - Robust Least Squares

feval4-101Create a fit result object and evaluate the object over a finer range in x.y = x.^2+(rand(size(x))-0.5);xx = (0:0.05:10)';fresult = fit

Page 88

fit4-1024fitPurpose Fit data using a library or custom model, a smoothing spline, or an interpolantSyntax fresult = fit(xdata,ydata,'ltype')

Page 89

fit4-103fresult = fit(xdata,ydata,'ltype','PropertyName', PropertyValue,...)fits the data using the options specified by PropertyN

Page 90 - Nonlinear Least Squares

1 Getting Started with the Curve Fitting Toolbox1-4To load cdate and pop into the Curve Fitting Tool, select the appropriate variable names from the X

Page 91

fit4-104example, the information returned for nonlinear least squares fits is given below. Remarks For rationals and Weibull library models, the coeff

Page 92 - Library Models

fit4-105Example Fit the census data with a second-degree polynomial library model and return the goodness of fit statistics and the output structure.l

Page 93 - Polynomials

fitoptions4-1064fitoptionsPurpose Create or modify a fit options objectSyntax opts = fitoptionsopts = fitoptions('ltype')opts = fitoptions(&

Page 94 - Power Series

fitoptions4-107opts = fitoptions('ltype') creates a default fit options object for the library or custom fit type specified by ltype. You ca

Page 95 - Sum of Sines

fitoptions4-108Additional Fit OptionsIf Method is NearestInterpolant, LinearInterpolant, PchipInterpolant, or CubicSplineInterpolant, there are no add

Page 96 - Custom Equations

fitoptions4-109If Method is NonlinearLeastSquares, the additional fit option properties shown below are available.Property DescriptionRobustSpecifies

Page 97 - Linear Equations

fitoptions4-110Example Create an empty fit options object and configure the object so that data is normalized before fitting.opts = fitoptions;opts.No

Page 98 - General Equations

fitoptions4-111You can return values for some fit options with the fit function. For example, fit the census data using a smoothing spline and return

Page 99 - Specifying Fit Options

fitoptions4-112The fit results are shown below.gfitgfit = General model Gauss2: gfit(x) = a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2)

Page 100 - Fit Convergence Criteria

fittype4-1134fittypePurpose Create a fit type objectSyntax ftype = fittype('ltype')ftype = fittype('expr')ftype = fittype('ex

Page 101 - Coefficient Parameters

Fitting the Data1-5Fitting the DataYou fit data with the Fitting GUI. You open this GUI by clicking the Fitting button on the Curve Fitting Tool. The

Page 102

fittype4-114ftype = fittype('expr','PropertyName',PropertyValue,...) creates a fit type object using the specified property name/p

Page 103 - Residuals

fittype4-115Create a fit type object for the rat33 library model. Note that the display includes the full equation.ftype = fittype('rat33')f

Page 104 - Fitting Data

get4-1164getPurpose Return properties for a fit options objectSyntax get(opts)a = get(opts)a = get(opts,'PropertyName')ArgumentsDescriptiong

Page 105 - Goodness of Fit Statistics

integrate4-1174integratePurpose Integrate a fit result objectSyntax inty = integrate(fresult,x,x0)ArgumentsDescriptioninty = integrate(fresult,x,x0) i

Page 106 - Table of fits

plot4-1184plotPurpose Plot data, fit, prediction bounds, outliers, and residualsSyntax plot(fresult)plot(fresult,xdata,ydata)plot(fresult,xdata,ydata,

Page 107 - Parametric Fitting

plot4-119plot(fresult,'s1',xdata,ydata,'s2') plots the fit result object using the color, symbol, and line type specified by the s

Page 108

plot4-120plot(...,'ptype1','ptype2',...,conflev) plots prediction bounds with the confidence level specified by conflev. conflev m

Page 109

plot4-121Plot the residuals.subplot(2,1,2)plot(fit1,'k-',x,y,'b.','residuals');−8 −6 −4 −2 0 2 4 6 8−1.5−1−0.500.511.52x

Page 110 - View->Confidence Level

plot4-122Plot 99% confidence and prediction bounds for the function and for a new observation.plot(fit1,'k-',x,y,'b.','predf&

Page 111

predint4-1234predintPurpose Compute prediction bounds for new observations or for the functionSyntax ci = predint(fresult,x)ci = predint(fresult,x,lev

Page 112

How to Contact The MathWorks:www.mathworks.com Webcomp.soft-sys.matlab [email protected] Technical [email protected] Product e

Page 113 - View->Residuals menu item

1 Getting Started with the Curve Fitting Toolbox1-64 Fit the additional library equations.For fits of a given type (for example, polynomials), you sho

Page 114

predint4-124If simopt is off, nonsimultaneous bounds are calculated. If simopt is on, simultaneous bounds are calculated. Nonsimultaneous bounds take

Page 115

predint4-125Plot the data, fit, and confidence bounds.subplot(2,2,1), plot(fresult,x,y), hold on, plot(x,c1,'k-.')legend('data',&a

Page 116

set4-1264setPurpose Configure or display property values for a fit options objectSyntax set(opts)a = set(opts)set(opts,'PropertyName',Proper

Page 117 - Example: Rational Fit

set4-127Example Create a custom nonlinear model, and create a default fit options object for the model.mymodel = fittype('a*x^2+b*exp(n*c*x)&apos

Page 118

smooth4-1284smoothPurpose Smooth the response dataSyntax yy = smooth(ydata)yy = smooth(ydata,span)yy = smooth(ydata,'method')yy = smooth(yda

Page 119

smooth4-129are given below. For the Savitzky-Golay method, the default polynomial degree is 2.yy = smooth(ydata,span,'method') smooths data

Page 120

smooth4-130Remarks For the moving average and Savitzky-Golay methods, span must be odd. If an even span is specified, it is reduced by 1. If span is g

Page 121

smooth4-131The first four elements of yy are given byyy(1) = y(1)yy(2) = (y(1)+y(2)+y(3))/3yy(3) = (y(1)+y(2)+y(3)+y(4)+y(5))/5yy(4) = (y(2)+y(3)+y(4)

Page 122 - New Equation button

smooth4-132Note how the outliers have less effect with the robust method.See Also fit, sort0 5 10 15−10123Original DataSmoothed Data Using ’loess’0 5

Page 123

I-1IndexNumerics6MADrobust fitting 3-12robust smoothing 2-17Aadjusted residuals 3-12adjusted R-square 3-31algorithms 3-15Analysis GUIcensus data examp

Page 124

Fitting the Data1-7The data, fit, and residuals are shown below. You display the residuals as a line plot by selecting the menu item View->Residual

Page 125

IndexI-2Curve Fitting ToolFourier series example 3-54Gaussian example 3-58Legendre polynomial example 3-50nonparametric fit example 3-74opening with c

Page 126

IndexI-3error sum of squares 3-30evaluating the goodness of fitavailable measures 3-27example 3-37examplesevaluating the goodness of fit 3-37excluding

Page 127

IndexI-4robust fit example 3-64Table of Fits 1-5fittype function 4-113flvote2k data set 3-61Fourier seriesexample 3-52fit type definition 3-16function

Page 128

IndexI-5Hhahn1 data set 3-41hat matrix 3-9Iimporting data 1-3description 2-2example 2-4influential data 2-28Infsimporting 2-3removing 2-41integrate fu

Page 129

IndexI-6nonlinear equationscustom 3-22fit options 3-23fitting 3-14nonlinear least squares 3-14nonparametric fittingexample 3-72methods 3-68normal dist

Page 130

IndexI-7Rrationalsexample 3-41fit type definition 3-19regressionsum of squares 3-30weightsleast squares 3-9smoothing 2-14removing Infs, NaNs, and outl

Page 131

IndexI-8smoothing datadefinition 2-9example 2-21local regression 2-14moving average filtering 2-12robust procedure 2-17Savitzky-Golay filtering 2-19sm

Page 132

1 Getting Started with the Curve Fitting Toolbox1-8When you fit higher degree polynomials, the Results area displays this warning:Equation is badly co

Page 133

Fitting the Data1-9• The fit and residuals for the single-term exponential equation indicate it is a poor fit overall. Therefore, it is a poor choice

Page 134

1 Getting Started with the Curve Fitting Toolbox1-10Because the goal of fitting the census data is to extrapolate the best fit to predict future popul

Page 135

Fitting the Data1-11Examining the Numerical Fit ResultsBecause you can no longer eliminate fits by examining them graphically, you should examine the

Page 136

1 Getting Started with the Curve Fitting Toolbox1-12The numerical fit results are shown below. You can click the Table of Fits column headings to sort

Page 137 - Example: Robust Fit

Fitting the Data1-13To resolve this issue, examine the confidence bounds for the remaining fits. By default, 95% confidence bounds are calculated. You

Page 138

1 Getting Started with the Curve Fitting Toolbox1-14The cfit object display includes the model, the fitted coefficients, and the confidence bounds for

Page 139

Analyzing the Fit1-15Analyzing the FitYou can evaluate (interpolate or extrapolate), differentiate, or integrate a fit over a specified data range wit

Page 140

iContentsPrefaceWhat Is the Curve Fitting Toolbox? . . . . . . . . . . . . . . . . . . . . . . viExploring the Toolbox . . . . . . . . . . . . . .

Page 141

1 Getting Started with the Curve Fitting Toolbox1-16The extrapolated values and the census data set are displayed together in a new figure window.Savi

Page 142

Saving Your Work1-17Saving Your WorkThe Curve Fitting Toolbox provides you with several options for saving your work. For example, as described in “Sa

Page 143

1 Getting Started with the Curve Fitting Toolbox1-18Saving the SessionThe curve fitting session is defined as the current collection of fits for all d

Page 144 - Nonparametric Fitting

Saving Your Work1-19Generating an M-FileYou may want to generate an M-file so that you can continue data exploration and analysis from the MATLAB comm

Page 145

1 Getting Started with the Curve Fitting Toolbox1-20For example, the help for the censusfit M-file indicates that the variables cdate and pop are requ

Page 146 - Smoothing Spline

2Importing, Viewing, and Preprocessing DataThis chapter describes how to import, view, and preprocess data with the Curve Fitting Toolbox. You import

Page 147

2 Importing, Viewing, and Preprocessing Data2-2Importing Data SetsYou import data sets into the Curve Fitting Tool with the Data Sets pane of the Data

Page 148

Importing Data Sets2-3Construct and Name the Data Set• Import workspace vectors — All selected variables must be the same length. You can import only

Page 149 - Apply button

2 Importing, Viewing, and Preprocessing Data2-4Example: Importing DataThis example imports the ENSO data set into the Curve Fitting Toolbox using the

Page 150

Importing Data Sets2-53 Click the Create data set button.The Data sets list box displays all the data sets added to the toolbox. Note that you can con

Page 151 - Selected Bibliography

ii ContentsSaving Your Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17Saving the Session . . . . . . . . . . . .

Page 152

2 Importing, Viewing, and Preprocessing Data2-6Viewing DataThe Curve Fitting Toolbox provides two ways to view imported data:• Graphically in a scatte

Page 153 - Function Reference

Viewing Data2-7You can change the color, line width, line style, and marker type of the displayed data points using the right-click menu shown below.

Page 154 - Functions – By Category

2 Importing, Viewing, and Preprocessing Data2-8Viewing Data NumericallyYou can view the numerical values of a data set, as well as data points to be e

Page 155 - General Purpose

Smoothing Data2-9Smoothing DataIf your data is noisy, you might need to apply a smoothing algorithm to expose its features, and to provide a reasonabl

Page 156 - Functions – Alphabetical List

2 Importing, Viewing, and Preprocessing Data2-10The Curve Fitting Toolbox supports these smoothing methods: • Moving average filtering — Lowpass filte

Page 157

Smoothing Data2-11Data Sets• Original data set — Select the data set you want to smooth.•Smoothed data set — Specify the name of the smoothed data set

Page 158 - Description

2 Importing, Viewing, and Preprocessing Data2-12- Click Delete to delete one or more data sets. To select multiple data sets, you can use the Ctrl key

Page 159 - See Also cfit, fit, fittype

Smoothing Data2-13Note that ys(1), ys(2), ... ,ys(end) refer to the order of the data after sorting, and not necessarily the original order.The smooth

Page 160 - Syntax cftool

2 Importing, Viewing, and Preprocessing Data2-14Lowess and Loess: Local Regression SmoothingThe names “lowess” and “loess” are derived from the term “

Page 161

Smoothing Data2-152 A weighted linear least squares regression is performed. For lowess, the regression uses a first degree polynomial. For loess, the

Page 162 - The Data GUI

iii3Fitting DataThe Fitting Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Parametric Fitting . . . . . . . . .

Page 163 - The Fitting GUI

2 Importing, Viewing, and Preprocessing Data2-16Using the lowess method with a span of five, the smoothed values and associated regressions for the fi

Page 164 - The Plotting GUI

Smoothing Data2-17Robust Smoothing ProcedureIf your data contains outliers, the smoothed values can become distorted, and not reflect the behavior of

Page 165 - The Analysis GUI

2 Importing, Viewing, and Preprocessing Data2-18The smoothing results of the lowess procedure are compared below to the results of the robust lowess p

Page 166 - Syntax ci = confint(fresult)

Smoothing Data2-19Savitzky-Golay FilteringSavitzky-Golay filtering can be thought of as a generalized moving average. You derive the filter coefficien

Page 167 - See Also fit

2 Importing, Viewing, and Preprocessing Data2-20Plot (a) shows the noisy data. To more easily compare the smoothed results, plots (b) and (c) show the

Page 168 - Syntax xds = datastats(xdata)

Smoothing Data2-21Example: Smoothing DataThis example smooths the ENSO data set using the moving average, lowess, loess, and Savitzky-Golay methods wi

Page 169

2 Importing, Viewing, and Preprocessing Data2-22The Smooth pane shown below displays all the new data sets generated by smoothing the original ENSO da

Page 170

Smoothing Data2-23Use the Plotting GUI to display only the data sets of interest. As shown below, the periodic structure of the ENSO data set becomes

Page 171 - See Also cfit, fit, integrate

2 Importing, Viewing, and Preprocessing Data2-24Saving the ResultsBy clicking the Save to workspace button, you can save a smoothed data set as a stru

Page 172 - Syntax obj

Excluding and Sectioning Data2-25Excluding and Sectioning DataIf there is justification, you might want to exclude part of a data set from a fit. Typi

Page 173

iv Contents

Page 174

2 Importing, Viewing, and Preprocessing Data2-26You mark data to be excluded from a fit with the Exclude GUI, which you open from the Curve Fitting To

Page 175

Excluding and Sectioning Data2-27Exclude Individual Data Points• Select data set — Select the data set from which data points will be marked as exclud

Page 176

2 Importing, Viewing, and Preprocessing Data2-28by a particular distribution, which is often assumed to be Gaussian. The statistical nature of the dat

Page 177 - See Also fit, fittype

Excluding and Sectioning Data2-29Two types of influential data points are shown below for generated data. Also shown are cubic polynomial fits and a r

Page 178

2 Importing, Viewing, and Preprocessing Data2-30SectioningSectioning involves specifying a range of response data or a range of predictor data to excl

Page 179

Excluding and Sectioning Data2-31Two examples of sectioning by domain are shown below for generated data.Plot (a) shows the data set sectioned by fit

Page 180

2 Importing, Viewing, and Preprocessing Data2-32Example: Excluding and Sectioning DataThis example modifies the ENSO data set to illustrate excluding

Page 181

Excluding and Sectioning Data2-33To mark data points for exclusion in the GUI, place the mouse cursor over the data point and left-click. The excluded

Page 182 - Syntax opts = fitoptions

2 Importing, Viewing, and Preprocessing Data2-34The Exclude GUI for this example is shown below.To save the exclusion rule, click the Create exclusion

Page 183

Excluding and Sectioning Data2-35Viewing the Exclusion RuleTo view the exclusion rule, select an existing exclusion rule name and click the View butto

Page 184 - Additional Fit Options

PrefaceThis chapter provides an overview of the Curve Fitting Toolbox, as well as information about this documentation. The sections are as follows.W

Page 185

2 Importing, Viewing, and Preprocessing Data2-36the amplitude starting point is reasonably close to the expected value, but the frequency and phase co

Page 186

Excluding and Sectioning Data2-37To produce a reasonable fit, follow these steps:1 Create an exclusion rule that includes one or two periods, and excl

Page 187

2 Importing, Viewing, and Preprocessing Data2-382 Create a new fit using the single-term sine equation with the exclusion rule 1Period applied.The fit

Page 188

Excluding and Sectioning Data2-393 Fit the entire data set using the fitted coefficient values from the previous step as starting values.The Fitting G

Page 189

2 Importing, Viewing, and Preprocessing Data2-40Additional Preprocessing StepsAdditional preprocessing steps not available through the Curve Fitting T

Page 190

Additional Preprocessing Steps2-41There are several disadvantages associated with performing transformations:• For the log transformation, negative re

Page 191

2 Importing, Viewing, and Preprocessing Data2-42Selected Bibliography[1] Cleveland, W.S., “Robust Locally Weighted Regression and Smoothing Scatterplo

Page 192

3Fitting DataCurve fitting refers to fitting curved lines to data. The curved line comes from regression techniques, a spline calculation, or interpo

Page 193 - 4integrate

3 Fitting Data3-2The Fitting ProcessYou fit data using the Fitting GUI. To open the Fitting GUI, click the Fitting button from the Curve Fitting Tool.

Page 194

The Fitting Process3-31 Select a data set and fit name.- Select the name of the current fit. When you click New fit or Copy fit, a default fit name is

Page 195

Preface viWhat Is the Curve Fitting Toolbox?The Curve Fitting Toolbox is a collection of graphical user interfaces (GUIs) and M-file functions built

Page 196

3 Fitting Data3-4Parametric FittingParametric fitting involves finding coefficients (parameters) for one or more models that you fit to data. The data

Page 197 - Plot the residuals

Parametric Fitting3-5Basic Assumptions About the ErrorWhen fitting data that contains random variations, there are two important assumptions that are

Page 198 - , plot (built-in), subplot

3 Fitting Data3-6The Least Squares Fitting MethodThe Curve Fitting Toolbox uses the method of least squares when fitting data. The fitting process req

Page 199

Parametric Fitting3-7To solve this equation for the unknown coefficients p1 and p2, you write S as a system of n simultaneous linear equations in two

Page 200

3 Fitting Data3-8Solving for b2 using the b1 valueAs you can see, estimating the coefficients p1 and p2 requires only a few simple calculations. Exten

Page 201 - See Also confint, fit

Parametric Fitting3-9where XT is the transpose of the design matrix X. Solving for b,In MATLAB, you can use the backslash operator to solve a system o

Page 202 - Syntax set(opts)

3 Fitting Data3-10where wi are the weights. The weights determine how much each response value influences the final parameter estimates. A high-qualit

Page 203 - See Also fitoptions, get

Parametric Fitting3-11The weights you supply should transform the response variances to a constant value. If you know the variances of your data, then

Page 204 - Syntax yy = smooth(ydata)

3 Fitting Data3-12the line get reduced weight. Points that are farther from the line than would be expected by random chance get zero weight.For most

Page 205

Parametric Fitting3-134 If the fit converges, then you are done. Otherwise, perform the next iteration of the fitting procedure by returning to the fi

Page 206

What Is the Curve Fitting Toolbox? viiYou can explore the graphical environment by typingcftoolClick the GUI Help buttons to learn how to proceed. Add

Page 207

3 Fitting Data3-14Nonlinear Least SquaresThe Curve Fitting Toolbox uses the nonlinear least squares formulation to fit a nonlinear model to data. A no

Page 208 - See Also fit, sort

Parametric Fitting3-153 Adjust the coefficients and determine whether the fit improves. The direction and magnitude of the adjustment depend on the fi

Page 209 - Numerics

3 Fitting Data3-16Library ModelsThe parametric library models provided by the Curve Fitting Toolbox are described below.ExponentialsThe toolbox provid

Page 210

Parametric Fitting3-17For more information about the Fourier series, refer to “Fourier Analysis and the Fast Fourier Transform” in the MATLAB document

Page 211

3 Fitting Data3-18conversion for a Type J thermocouple in the 0o to 760o temperature range is described by a seventh-degree polynomial.Note If you do

Page 212

Parametric Fitting3-19RationalsRational models are defined as ratios of polynomials and are given bywhere n is the degree of the numerator polynomial

Page 213

3 Fitting Data3-20difference is that the sum of sines equation includes the phase constant, and does not include a DC offset term.Weibull Distribution

Page 214

Parametric Fitting3-21You create custom equations with the Create Custom Equation GUI. The GUI contains two panes: a pane for creating linear equation

Page 215 - Infs, NaNs, and outliers 2-41

3 Fitting Data3-22• Equation — The custom equation.•Equation name — The name of the equation. By default, the name is automatically updated to be iden

Page 216

Parametric Fitting3-23• Equation name — The name of the equation. By default, the name is automatically updated to be identical to the custom equation

Commentaires sur ces manuels

Pas de commentaire