24 views

Uploaded by Anonymous XedXnFBz0I

j

- PRINCIPLES OF MAPPING WITH PETREL©
- Ch11
- Para Hp 50g Programas Matema
- Numerical+Analysis+Chapter+3.2
- Appendix F- SteamTable Smith
- Interpolation Methods
- Assign3_2016A
- whats map projection
- COSM_QB
- Chebyshev.pdf
- CH03_5C_4
- Introduction to Polynomials
- WorstAssignment2019.docx
- Afghanistan Precip
- EfficientSincInterpolation_ApllOpt
- Design of Machinery, Mathcad, Matlab y Working Model Basic Software Manual
- algebra-ii-m1-topic-a-lesson-5-student
- algebra 2 - semester 1 2015
- The Finite Element Method a Review
- Summary PUB LML 151000 f

You are on page 1of 10

example

Load some data, fit a quadratic curve to variables cdate and pop, and plot the fit and data.

load census;

f=fit(cdate,pop,'poly2')

plot(f,cdate,pop)

f =

Linear model Poly2:

f(x) = p1*x^2 + p2*x + p3

Coefficients (with 95% confidence bounds):

p1 =

0.006541 (0.006124, 0.006958)

p2 =

-23.51 (-25.09, -21.93)

p3 =

2.113e+04 (1.964e+04, 2.262e+04)

fitobject = fit([x,y],z,fitType)

example

Load some data and fit a polynomial surface of degree 2 in x and degree 3 in y. Plot the fit and data.

load franke

sf = fit([x, y],z,'poly23')

plot(sf,[x,y],z)

Linear model Poly23:

sf(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p21*x^2*y

+ p12*x*y^2 + p03*y^3

Coefficients (with 95% confidence bounds):

p00 =

1.118 (0.9149, 1.321)

p10 = -0.0002941 (-0.000502, -8.623e-05)

p01 =

1.533 (0.7032, 2.364)

p20 = -1.966e-08 (-7.084e-08, 3.152e-08)

p11 =

0.0003427 (-0.0001009, 0.0007863)

p02 =

-6.951 (-8.421, -5.481)

p21 =

9.563e-08 (6.276e-09, 1.85e-07)

p12 = -0.0004401 (-0.0007082, -0.0001721)

p03 =

4.999 (4.082, 5.917)

fitobject = fit(x,y,fitType,fitOptions)

example

Load and plot the data, create fit options and fit type using the fittype and fitoptions functions, then

create and plot the fit.

Load and plot the data in census.mat.

load census

plot(cdate,pop,'o')

Create a fit options object and a fit type for the custom nonlinear model

coefficients and n is a problem-dependent parameter.

fo = fitoptions('Method','NonlinearLeastSquares',...

'Lower',[0,0],...

'Upper',[Inf,max(cdate)],...

'StartPoint',[1 1]);

ft = fittype('a*(x-b)^n','problem','n','options',fo);

Fit the data using the fit options and a value of n = 2.

[curve2,gof2] = fit(cdate,pop,ft,'problem',2)

curve2 =

General model:

curve2(x) = a*(x-b)^n

Coefficients (with 95% confidence bounds):

a =

0.006092 (0.005743, 0.006441)

b =

1789 (1784, 1793)

Problem parameters:

n =

2

gof2 =

sse: 246.1543

rsquare:

dfe:

adjrsquare:

rmse:

0.9980

19

0.9979

3.5994

[curve3,gof3] = fit(cdate,pop,ft,'problem',3)

curve3 =

General model:

curve3(x) = a*(x-b)^n

Coefficients (with 95% confidence bounds):

a =

1.359e-05 (1.245e-05, 1.474e-05)

b =

1725 (1718, 1731)

Problem parameters:

n =

3

gof3 =

sse:

rsquare:

dfe:

adjrsquare:

rmse:

232.0058

0.9981

19

0.9980

3.4944

hold on

plot(curve2,'m')

plot(curve3,'c')

legend('Data','n=2','n=3')

hold off

fitobject = fit(x,y,fitType,Name,Value)

example

[fitobject,gof] = fit(x,y,fitType)

example

[fitobject,gof,output] = fit(x,y,fitType)

The following tables describe the library model types for curves and surfaces.

Use the links in the table for examples and detailed information on each library type.

If you want a quick reference of model names for input arguments to the fit function, see Model Names and

Equations.

Library Model Types for

Curves

Description

distribution

exponential

See Exponential Models.

fourier

Curves

Description

gaussian

interpolant

shape-preserving cubic spline. SeeNonparametric Fitting.

polynomial

power

Power function and sum of two power functions. See Power Series.

rational

in both the numerator and the denominator). See Rational Polynomials.

sin

spline

Surfaces

Description

interpolant

biharmonic, and thin-plate spline interpolation. See Interpolants.

lowess

polynomial

To specify the model you want to fit, consult the following tables for a model name to use as an input argument

to the fit function. For example, to specify a quadratic curve with model name "poly2" :

f = fit(x, y,

'poly2')

Examples of Polynomial Model Names for Curves

Equations

poly1

Y = p1*x+p2

poly2

Y = p1*x^2+p2*x+p3

poly3

Y = p1*x^3+p2*x^2+...+p4

...etc., up to poly9

Y = p1*x^9+p2*x^8+...+p10

For polynomial surfaces, model names are 'polyij', where i is the degree in x and j is the degree in y. The

maximum for both i and j is five. The degree of the polynomial is the maximum of i and j. The degree of x in

each term will be less than or equal to i, and the degree of y in each term will be less than or equal to j. See

the following table for some example model names and equations, of many potential examples.

Names for Surfaces

Equations

poly21

p11*x*y

poly13

p02*y^2 + p12*x*y^2 + p03*y^3

poly55

p05*y^5

Distribution Model Names

Equations

weibull

Y = a*b*x^(b-1)*exp(-a*x^b)

Exponential Model Names

Equations

exp1

Y = a*exp(b*x)

exp2

Y = a*exp(b*x)+c*exp(d*x)

Fourier Series Model

Names

Equations

fourier1

Y = a0+a1*cos(x*p)+b1*sin(x*p)

fourier2

Y = a0+a1*cos(x*p)+b1*sin(x*p)...

+a2*cos(2*x*p)+b2*sin(2*x*p)

fourier3

Y = a0+a1*cos(x*p)+b1*sin(x*p)...

+a3*cos(3*x*p)+b3*sin(3*x*p)

...etc., up

to fourier8

Y = a0+a1*cos(x*p)+b1*sin(x*p)...

+a8*cos(8*x*p)+b8*sin(8*x*p)

Where p = 2*pi/(max(xdata)-min(xdata)).

Gaussian Model Names and Equations

Gaussian Model

Names

Equations

Gaussian Model

Names

Equations

gauss1

Y = a1*exp(-((x-b1)/c1)^2)

gauss2

Y = a1*exp(-((x-b1)/c1)^2)+a2*... exp(-((xb2)/c2)^2)

gauss3

Y = a1*exp(-((x-b1)/c1)^2)+... +a3*exp(-((xb3)/c3)^2)

...etc., up

to gauss8

Power Model Names

Equations

power1

Y = a*x^b

power2

Y = a*x^b+c

Rational models are polynomials over polynomials with the leading coefficient of the denominator set to 1.

Model names are ratij, where i is the degree of the numerator and j is the degree of the denominator. The

degrees go up to five for both the numerator and the denominator.

Examples of Rational Model Names

Equations

rat02

Y = (p1)/(x^2+q1*x+q2)

rat21

Y = (p1*x^2+p2*x+p3)/(x+q1)

rat55

Y = (p1*x^5+...+p6)/(x^5+...+q5)

Sum of Sine Model Names

Equations

sin1

Y = a1*sin(b1*x+c1)

sin2

Y = a1*sin(b1*x+c1)+a2*sin... (b2*x+c2)

sin3

Y = a1*sin(b1*x+c1)+... +a3*sin(b3*x+c3)

Equations

...etc., up to sin8

Y = a1*sin(b1*x+c1)+... +a8*sin(b8*x+c8)

Spline models are supported for curve fitting, not for surface fitting.

Spline Model Names

Description

cubicspline

smoothingspline

Smoothing spline

Interpolant Model

Names

Description

linearinterp

Linear interpolation

nearestinterp

cubicinterp

Curves only

pchipinterp

(pchip) interpolation

Surfaces only

biharmonicinterp

thinplateinterp

Type

Curves and

Surfaces

Lowess models are supported for surface fitting, not for curve fitting.

Lowess Model Names

Description

lowess

loess

Fit

Fit model or boundary model to new or existing data, and provide summary statistics

Syntax

[statistics, model] = Fit(model, X, Y)

[statistics, model] = Fit(model)

B = mbcboundary.Fit(X,Type)

Description

This is a method of mbcmodel.model and mbcboundary.Model.

[statistics, model] = Fit(model, X, Y) This fits the model to the specified data. After you have

called Fit specifying the data to use, then you can refit the model by calling[statistics, model]

= Fit(model).

The response object that the model came from defines which summary statistics are returned. To see these

statistics, call SummaryStatistics. These statistics appear in the Summary Statistics pane of the Model

Browser GUI. The statistics returned depend on the model type.

For a linear model, the statistics are:

'Observations','Parameters','Box-Cox','PRESS RMSE','RMSE'.

For a neural network model:

'Observations','Parameters', 'Box-Cox','RMSE', 'R^2'.

B = mbcboundary.Fit(X,Type) creates and fits a boundary model to the data X, a double matrix. B is

an mbcboundary.Model object.

Examples

statistics = Fit(knot)

statistics =

27.0000

7.0000

1.0000

3.0184

2.6584

- PRINCIPLES OF MAPPING WITH PETREL©Uploaded byHcene Hcen
- Ch11Uploaded byAla Vin
- Para Hp 50g Programas MatemaUploaded bynandor103
- Numerical+Analysis+Chapter+3.2Uploaded byMudassir Hussain
- Appendix F- SteamTable SmithUploaded byNIX
- Interpolation MethodsUploaded byAllan Paolo
- Assign3_2016AUploaded bymurster101
- whats map projectionUploaded bymahmoud abdelrahman
- COSM_QBUploaded byLOKESH_IT08
- Chebyshev.pdfUploaded byVenkatarao Chukka
- CH03_5C_4Uploaded byFaisal Rahman
- Introduction to PolynomialsUploaded bywolfretonmaths
- WorstAssignment2019.docxUploaded byjoebug34
- Afghanistan PrecipUploaded byLuis Lorenzo Rodriguez Rojas
- EfficientSincInterpolation_ApllOptUploaded byAnonymous FGY7go
- Design of Machinery, Mathcad, Matlab y Working Model Basic Software ManualUploaded byDennis Elvir
- algebra-ii-m1-topic-a-lesson-5-studentUploaded byapi-244344768
- algebra 2 - semester 1 2015Uploaded byapi-278122461
- The Finite Element Method a ReviewUploaded byOzlem Ozgun
- Summary PUB LML 151000 fUploaded byAlexB7
- formative test final.docxUploaded byLeoni Francis Lagrama
- PolynomialsUploaded bySingh Karan
- Num Analysis CollinsUploaded byFavio90
- Alg 2 Practice Final Exam 1617Uploaded byRobin Layug
- 1-s2.0-0001870887900211-mainUploaded byAnaNkine
- Surfer Training GuideUploaded byIr Fakhrul Zakee
- The William Lowell Putnam Mathematical Competition Problems & Solutions, 2001-2008Uploaded byFernandoDiaz
- C. Von Kerczek and E.O. Tuck. the Representation of Ship Hulls by Conformal Mapping FunctionsUploaded byYuriyAK
- Effect-of-Elemental-Shape-and-Modeling-of-Mixed-Hybrid-FEM-on-Numerical-Solution_2014_Procedia-Engineering.pdfUploaded byIndriati Martha Patuti
- Analyzing the Galois Groups of Fifth-Degree and Fourth-Degree Polynomials (Berglund)Uploaded byyacp16761

- SECADO.pdfUploaded byFlor HG
- Wind Energy 2003 Landberg LUploaded byAnonymous XedXnFBz0I
- Semiconductores FinalUploaded byAnonymous XedXnFBz0I
- Diseño Maquinas Eolicas Sin Multiplicador Etsiim Industriales.pdfUploaded byAnonymous XedXnFBz0I
- LIBRO de Energía SolarUploaded byAnonymous XedXnFBz0I
- Dim.BombaUploaded byAnonymous XedXnFBz0I
- Munoz Leon Jose JuanUploaded byJuan Changotasig
- Energías Renovables y Desarrollo SustentableUploaded byAnonymous XedXnFBz0I
- Energías Renovables y Desarrollo SustentableUploaded byAnonymous XedXnFBz0I
- solubilidadUploaded byKardiasmita
- Medidas+de+Mitigación+de+GEIUploaded byAnonymous XedXnFBz0I
- Transporte y Reforma Energetica MexicoUploaded byAnonymous XedXnFBz0I
- Principios de ElectrolisisUploaded byBreidy Samboni
- Nama FinalUploaded byAnonymous XedXnFBz0I
- Alma Cena Mien ToUploaded byAnonymous XedXnFBz0I
- Diseño Maquinas Eolicas Sin Multiplicador Etsiim IndustrialesUploaded byAnonymous XedXnFBz0I
- 1. Estado Del ArteUploaded byAnonymous XedXnFBz0I
- GUIA AC 3D-2DUploaded byErick Javier Torres Manotas.
- turbinas_hidraulicasUploaded bysanmiguel000
- Presentación Introducción Al Almacenamiento de EnergíaUploaded byAnonymous XedXnFBz0I
- Sistemas de EcuacionesUploaded byDeivi Zúñiga
- DESARROLLO SUSTENTABLE.pdfUploaded bycharwins
- Medidas+de+Mitigación+de+GEIUploaded byAnonymous XedXnFBz0I
- Banco de Capacitores. FinalUploaded byAnonymous XedXnFBz0I
- G-Historia de La ComputacionUploaded byfruuxx
- 41616101Uploaded byAnonymous XedXnFBz0I
- PRODESEN 2015_2029Uploaded byAnonymous FIiBfzGF1F
- ._Diseño Maquinas Eolicas Sin Multiplicador Etsiim IndustrialesUploaded byAnonymous XedXnFBz0I
- sistema de ecuaciones linealesUploaded byluosfico

- saa-c01Uploaded bymobilebug1
- 940 Warehouse Shipping OrderUploaded byAnveshSandeep Vellalacheruvu
- PlanToPublishNew.pdfUploaded byioanamarinela
- A New Class of Chromatic Filters for Color ImageUploaded byClaudia Anghel
- A New Modelling Technique Using a Subsystem for Structural Schematic Design of Tall BuildingsUploaded byBeenah Sheila Khushiram
- BCM_6.30.223.245_WLAN_Release_Note.pdfUploaded bysirapu
- Ppl Cse It 2-2 April2012Uploaded byjcsekhar9
- Course Outline Media Uses ARTS2093(1)Uploaded byStephanie Lee
- cs757_manual1Uploaded byndaneman
- Comparative Analysis of Technology Advancement From Single Gate to Multi-gate MosfetUploaded byesatjournals
- Configuring Microsoft SQL Server 2008 Express Server Authentication for Use with InTouch Alarm DB Logger-TN497.pdfUploaded byMauricio Palacios
- BC-3000 Plus Service Training V2.0 EnUploaded byquankdd
- SCM-655 Case Study VF Template V04Uploaded byJamesTho
- Course OutlineUploaded byRoberto Hoffman
- Project Report Student Information SystemUploaded byFreeProjectz.com
- Ecotrix ProjectUploaded byOmen Protector
- An R Package for Dynamic Linear ModelsUploaded byIntroCPA
- XLRI GMP 2011 BrochureUploaded byPriyanka Sharma
- QUIZ 1.docxUploaded bysochiva pramesti
- YPT340 ManualUploaded byJuan Carlos Hernandez
- Rielly E.conrad. SMP93 - Standard Ship Motion Program User ManualUploaded byYuriyAK
- PSS/E Problem 6_1 solutionUploaded byashikhmd4467
- Toolkit i So 27001 Cross ReferencedUploaded byHooi Choon Yew
- Modelling An Overland Water Flow Path In An Urban Catchment Using GISUploaded byAI Coordinator - CSC Journals
- NGMP-DASIA10-Paper.pdfUploaded byDonika Markande
- VTT-R-04618-15Uploaded byHafidz Outsiders
- Tm1 Find OutsUploaded byrvk4
- Maximum_and_Minimum_Values.pdfUploaded byAnuj Tahlan
- TalendOpenStudio User Guide 22b EnUploaded bySrinivas
- tm1602_datasheet-v2Uploaded byAnonymous YDF1ID15zJ