6 views

Uploaded by Mouli

assignment

- 06 05 Adequacy of Regression Models
- PP-312 Method of Least Squares
- Analysis_and_Modeling_of_Roundness_Error.pdf
- Random Walk Problem
- Research Inventy : International Journal of Engineering and Science
- Avo Prim Attr
- 11-4 PC 3
- algebra 2h ab schedule
- JESD15-4
- 9 5 multiplying polynomials
- Analytical Study on Method of Solving Polynomial Inequalities
- 8 Polynomials
- Writing Questions in Algebra II
- A New Method for Prediction of Binary Gas-phase Diffusion Coefficient
- Estimasi Biaya - Kunci Jawaban
- 44630_UAS Fiskom
- Lab 4
- Ken Black QA 5th chapter16 Solution
- Managerial Economics-Jan2019.docx
- 13197_2012_Article_901

You are on page 1of 7

to Describe data.

Introduction to MATLAB

for Engineers, Third Edition

specific set of axes:

Chapter 6

when plotted on rectilinear axes. Its slope is m and its

intercept is b.

2. The power function y = bxm gives a straight line when

plotted on log-log axes.

3. The exponential function y = b(10)mx and its

equivalent form y = bemx give a straight line when

plotted on a semilog plot whose y-axis is logarithmic.

Regression

for non-profit use by instructors in courses for which this textbook has

been adopted. Any other use without publishers consent is unlawful.

6-2

exponential function y = 101x plotted on linear, semilog, and log-log axes..

1. Examine the data near the origin. The

exponential function can never pass through the

origin (unless of course b = 0, which is a trivial

case). (See Figure 6.11 for examples with b =

1.)

The linear function can pass through the origin only

if b = 0. The power function can pass through the

origin but only if m > 0. (See Figure 6.12 for

examples with b = 1.)

6-3

6-4

6-5

6-6

3. If you suspect a power function, plot the data using loglog scales. Only a power function will form a straight line

on a log-log plot. If you suspect an exponential function,

plot the data using the semilog scales. Only an

exponential function will form a straight line on a semilog

plot.

line, then it can be represented by the linear function and

you are finished. Otherwise, if you have data at x = 0,

then

a. If y(0) = 0, try the power function.

b. If y(0) 0, try the exponential function.

If data is not given for x = 0, proceed to step 3.

(continued)

(continued)

6-7

6-8

Steps for Function Discovery (continued)

4. In function discovery applications, we use the

log-log and semilog plots only to identify the

function type, but not to find the coefficients b

and m. The reason is that it is difficult to

interpolate on log scales.

5. Note that sometimes a high-order polynomial

(e.g. quadratic, cubic or higher) is the only

appropriate curve-fit, so you may need to try

using that if you do not see a decent trend. Lots

of natural phenomena behave exponentially or

like a power function, so polynomials should be a

last resort.

6-9

Command

Description

p =

polyfit(x,y,n)

data described by the vectors x and

y, where x is the independent

variable. Returns a row vector p of

length n + 1 that contains the

polynomial coefficients in order of

descending powers.

The polynomial of degree n is:

6-10

Data.

Syntax: p = polyfit(x,y,n)

w = p1z + p2

where the polynomial variables z and y are related to the

original data variables x and y by w = log10 y and z = log10x.

Thus we can find the power function that fits the data by

typing

polynomial to be fitted, and p is the vector of

polynomial coefficients.

The linear function: y = mx + b. In this case the

variables z and w in the polynomial w = p1z+ p2 are

the original data variables x and y, and we can find

the linear function that fits the data by typing p =

polyfit(x,y,1). The first element p1 of the vector

p will be m, and the second element p2 will be b.

6-11

p = polyfit(log10(x),log10(y),1)

6-12

second element p2 will be log10b. We can find b from b =

10p2 . You can equivalently replace 10 with e everywhere

in the formulae and obtain the same b and m.

It minimizes the sum of the squares of the residuals, J, for

N data points. J is defined as

log10 y = mx + log10b

which has the form

w = p1z + p2

where the polynomial variables z and w are related to the

original data variables x and y by w = log10 y and z = x. We

can find the exponential function that fits the data by typing

J =

[ f (xi ) yi ]2

curve fit for two or more functions used to describe the

same data. The function that gives the smallest J value

gives the best fit.

You can only compare the value of J where all the

functions are on the same basis (i.e. all plotted on

semilogy or all plotted on loglog).

p = polyfit(x, log10(y),1)

The first element p1 of the vector p will be m, and the

second element p2 will be log10b. We can find b from b =

10p2 . You can equivalently replace 10 with e everywhere in

the formulae and obtain the same b and m.

6-13

i=1

6-17

The polyfit function is based on the least-squares

method. Its syntax is

p =

polyfit(x,y,n)

data described by the vectors x

and y, where x is the independent

variable. Returns a row vector p of

length n+1 that contains the

polynomial coefficients in order of

descending powers.

6-18

6-20

Figure 6.2-1 on page 273.

Denote the sum of the squares of the deviation of

the y values from their mean y by S, which can be

computed from

N

S=

(yi y )2

(6.22)

i=1

If S is divided by N, then the variance (the square of

the standard deviation) is calculated.

6-21

6-23

r 2 is to 1, the better the fit. The largest r 2 can be is 1.

the quality of the curve fit, the coefficient of determination,

also known as the r-squared value. It is defined as

r = 1 J

S

2

possible for r 2 to be negative. Such cases, however,

are indicative of a very poor model that should not be

used.

(6.2-3)

around the mean, and the value of J indicates how

much of the data spread is unaccounted for by the

model.

Thus the ratio J / S indicates the fractional

variation unaccounted for by the model.

The r2-value can be used to compare any

models for the same data.

6-24

99% of the data variation. This value corresponds to

r 2 0.99. Real engineering data can be noisier, so it

is sometimes necessary to use the criterion r 2 0.8

for a good fit.

More? See pages 275-276.

6-25

a fifth-degree polynomial that passes through all six data

points but exhibits large excursions between points. Figure

6.2-2, page 274.

1. Large excursion between data points

2. The coefficients often require a large number of

significant figures to accurately represent the data.

6-22

page 279.

The effect of computational errors in computing the

coefficients can be lessened by properly scaling the

x values. You can scale the data yourself before

using polyfit. Some common scaling methods

are

1. Subtract the minimum x value or the mean x value

from the x data, if the range of x is small, or

2. Divide the x values by the maximum value or the

mean value, if the range is large.

Residuals are the error between the data and the model:

a model predicts the

data well and where

it doesnt.

6-26

6-29

See pages

277-279.

Using left-division

square method in certain cases and this can be

used to determine the polynomial coefficients.

interface. Using this interface, you can quickly perform

basic curve fitting tasks within the same easy-to-use

environment. The interface is designed so that you can:

Example:

degree 10.

Plot multiple fits simultaneously for a given data set.

Plot the residuals.

Examine the numerical results of a fit.

Interpolate or extrapolate a fit.

Annotate the plot with the numerical fit results and

the norm of residuals.

Save the fit and evaluated results to the MATLAB

workspace.

a=X\y

6-32

6-31

Figure 6.3-2, page 285.

6-33

More?

See

pages

284-285.

- 06 05 Adequacy of Regression ModelsUploaded byJohn Bofarull Guix
- PP-312 Method of Least SquaresUploaded bySunit Arora
- Analysis_and_Modeling_of_Roundness_Error.pdfUploaded byCarlosQuelart
- Random Walk ProblemUploaded byAdam
- Research Inventy : International Journal of Engineering and ScienceUploaded byinventy
- Avo Prim AttrUploaded byPipe Garcia
- 11-4 PC 3Uploaded bybriandmcneill
- algebra 2h ab scheduleUploaded byapi-424407994
- JESD15-4Uploaded byAniketKulkarni
- 9 5 multiplying polynomialsUploaded byapi-261989431
- Analytical Study on Method of Solving Polynomial InequalitiesUploaded byIJSTE
- 8 PolynomialsUploaded byMonic Romero
- Writing Questions in Algebra IIUploaded bySam Shah
- A New Method for Prediction of Binary Gas-phase Diffusion CoefficientUploaded bychitreau
- Estimasi Biaya - Kunci JawabanUploaded byGita Akoeb
- 44630_UAS FiskomUploaded bySoffi Lutfia Dewi Trizana
- Lab 4Uploaded bybbarry138
- Ken Black QA 5th chapter16 SolutionUploaded byRushabh Vora
- Managerial Economics-Jan2019.docxUploaded byNANTHA KUMARAN
- 13197_2012_Article_901Uploaded byLaylla Coelho
- Output EviewsUploaded byPrasetyo Adi Priatno
- Performance Evaluation of PVD Coated Ceramic Insert Using AISI 52100 in Hard TurningUploaded byAnonymous vQrJlEN
- ps1Uploaded byzooi2301
- 1041_partC_S2_15Uploaded byShirley Liu
- Social Report 2004 - Educational Performance and Social Background in International ComparisonUploaded byTARKI_Research
- CCSS Math ExcelUploaded byAli Hüthüt
- Shazam resultUploaded byanjie_delarosa
- MATH 112Uploaded byLouise Ena Dunton
- Module1 12 SurveyCommandsinStata CAzzariUploaded bymelonpp
- practical_problems_in_slr.docUploaded byAkhilesh

- EmiUploaded byMouli
- SOC_WOUCUploaded byMouli
- Extremal TraceUploaded byMouli
- FittingUploaded byMouli
- Seat Confirmation Fee Letter.pdfUploaded byMouli
- Matsysbok.ps PagesUploaded byMouli
- Input DesignUploaded byMouli
- barrat2000aUploaded byMouli
- CharacterUploaded byRomeo Mana
- GATE-Admission 2016 CutoffsUploaded byArun Kashyap
- Dynamic Interpretation of eignevlaueUploaded byGareth Vio
- lin-fctsUploaded byMouli
- DubeyUploaded byMouli
- El Lips OidsUploaded byMouli
- Estimation ExampleUploaded byMouli
- The OdysseyUploaded byKeltoum Elattar Amalay
- ENG3104_assignment2Uploaded byMouli
- Bhargav (1)Uploaded byMouli
- NID Admissions 2016-17Uploaded byMouli
- HtsUploaded byMouli
- Half-bridge Module - Skm400gb12t4_semikronUploaded bynicos1
- Module 06Uploaded byMouli
- Module 04Uploaded byMouli
- Lec03Uploaded byShahid KI
- Networking Interview QuestionsUploaded bySidrah Tariq
- c++interviewquestionsUploaded byhiraman7032
- Module 08Uploaded byMouli
- Module 09Uploaded byMouli
- howtopdfUploaded byvarokas

- Introduction to Music Production - Week 2 Assignment.pdfUploaded byjrdpastors
- ReyesUploaded byAljohn Mark Reyes
- Week 11-12-13-14Uploaded byapi-3737023
- Joomla All in AllUploaded bySyed Zahirul Kuaiyum
- Xk3y User ManualUploaded byFible1956
- A14_max_qrgUploaded byYass
- Bansal A.K.-Introduction to programming languages-CRC (2010).pdfUploaded bylayiro2
- Automatic Error Detection and Correction in MalayalamUploaded byIJSTE
- Maharashtra Tenders - BidAssist.pptxUploaded byBidAssist
- PROBABILITY BASED CLUSTER EXPANSION OVERSAMPLING TECHNIQUE FOR IMBALANCED DATAUploaded byCS & IT
- CSQA Certification ProposalUploaded byDarius Samah
- Art 1Uploaded byLuz Fiorella Cumpa Gómez
- Convolutional Neural Networks in PythonUploaded byAnonymous rsGzBBiqk
- Certified Mail Secure Email ServerUploaded byArun Ng
- ETG Brochure (en)Uploaded byJorge Andril
- Docdownloader.com Solved Mcq of Computer Security and Network SecurityUploaded byYazan Aswad
- Xm Land DatabasesUploaded byKannan Rock
- Magstar and IBM 3590 High Performance Tape Subsystem TechnicUploaded byLuis Tavis
- RFID Controlled With Mems Sensor (1)Uploaded bySandeep Reddy
- 009-1126-01 Hst-smrtd Savant Smart Host QrgUploaded byferna2420
- UnixUploaded byapi-27495803
- Bizhub c287 c227 Quick Reference en 1 0 0Uploaded byBadr Biuo
- Queue Type Pcq-mangle-queue Tree v2 ReloadUploaded byRafa Sena
- Guideline for Task 2 Detail and Topographic SurveyingUploaded byscha_lina
- Object Oriented Modeling and DesignUploaded byEthan Hunt
- Developing Android on Android Automate Your Device With Scripts and TasksUploaded byLiviu
- Chapter 6 - Review QuestionsUploaded byCharis Marie Urgel
- Justin Moro RésuméUploaded byJustin Moro
- DSF_LAB MANUAL(SE IT)Uploaded byAvi Surywanshi
- ReadMeUploaded byRey Mundo