Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Assignment 1

linear and Angular measurements


Draw neat sketches of the following linear and angular measuring instruments:
1. Vernier Caliper
2. Vernier depth gauge 10 marks
3. Vernier height gauge
4. Height master
5. External and internal micrometer Due date: 19th February, 2019
6. Jaw and caliper type inside micrometer
7. Depth and bench micrometer
8. Digital micrometer and telescopic gauge
9. Universal bevel protractor and sine bar.

Note: Use A3 sheets for drawing


REGRESSION
ANALYSIS
CONTENTS

• Obtain fit parameters y=mx+b: m=? b=?

• An example

• Regression coefficient R2 and it’s meaning

• An examples showing regression using Microsoft excel.


Y En=yn-(mxn+b)

(xn,yn)
(x2,y2)

Best fit line y=mx+b


E2=y2-(mx2+b) m- slope
b- y intercept

E1=y1-(mx1+b)

(x1,y1)
(0, b)

X
𝑺𝒒𝒖𝒂𝒓𝒆𝒅 𝒆𝒓𝒓𝒐𝒓 𝑺𝑬 𝒍𝒊𝒏𝒆 = 𝒚𝟏 − (𝒎𝒙𝟏 + 𝒃 )𝟐 + 𝒚𝟐 − (𝒎𝒙𝟐 + 𝒃 )𝟐 + … + 𝒚𝒏 − (𝒎𝒙𝒏 + 𝒃 )𝟐

Find the m and b to minimize SE line.


𝑆𝐸 𝑙𝑖𝑛𝑒 = 𝑦12 − 2𝑦1 𝑚𝑥1 − 2𝑦1 𝑏 + 𝑚2 𝑥12 + 2𝑚𝑥1 𝑏 + 𝑏 2 +
𝑦22 − 2𝑦2 𝑚𝑥2 − 2𝑦2 𝑏 + 𝑚2 𝑥22 + 2𝑚𝑥2 𝑏 + 𝑏 2 +
⋮ ⋮ ⋮

𝑦𝑛2 − 2𝑦𝑛 𝑚𝑥𝑛 − 2𝑦𝑛 𝑏 + 𝑚2 𝑥𝑛2 + 2𝑚𝑥𝑛 𝑏 + 𝑏 2

∴ 𝑆𝐸 𝑙𝑖𝑛𝑒 = (𝑦12 +𝑦22 ⋯ 𝑦𝑛2 ) − 2𝑚 𝑥1 𝑦1 + 𝑥2 𝑦2 +. . . . . 𝑥𝑛 𝑦𝑛 − 2𝑏(𝑦1 +𝑦2 . . . . . 𝑦𝑛 )


+𝑚2 (𝑥12 +𝑥22 ⋯ 𝑥𝑛2 ) +2𝑚𝑏(𝑥1 +𝑥2 . . . . . 𝑥𝑛 ) + 𝑛𝑏 2
𝒚𝟐 − 𝟐𝒎𝒏𝒙𝒚 − 𝟐𝒃𝒏ഥ
∴ 𝑺𝑬 𝒍𝒊𝒏𝒆 = 𝒏ഥ 𝒚 + 𝒎𝟐 𝒏𝒙𝟐 + 𝟐𝒎𝒃𝒏ഥ
𝒙 + 𝒏𝒃𝟐

𝜕(𝑆𝐸) 𝜕(𝑆𝐸)
= 0 𝑎𝑛𝑑 =0
𝜕𝑚 𝜕𝑏

𝜕(𝑆𝐸) yields
=−𝟐𝒏𝒙𝒚+𝟐𝒎𝒏𝒙𝟐 +𝟐𝒃𝒏ഥ
𝒙=0 𝒎𝒙𝟐 + 𝒃ഥ
𝒙 = 𝒙𝒚
𝜕𝑚

𝜕(𝑆𝐸) yields 𝒎ഥ
𝒙+b=ഥ
𝒚
= 𝒚+𝟐𝒎𝒏ഥ
-𝟐𝒏ഥ 𝒙+2nb=0
𝜕𝑏
𝒎𝒙𝟐 + 𝒃ഥ
𝒙 = 𝒙𝒚 𝒎ഥ ഥ
𝒙+𝒃=𝒚
𝒎ഥ
𝒙+b=ഥ
𝒚 𝒙𝟐 𝒙𝒚
𝒎 +𝒃=

𝒙 ഥ
𝒙
Subtracting

𝒙𝟐 𝒙𝒚
ഥ−
𝒎 𝒙 ഥ−
= 𝒚

𝒙 ഥ
𝒙

𝒙𝒚 𝒙𝟐
𝒎= 𝒚ഥ− ഥ−
÷ 𝒙

𝒙 ഥ
𝒙
ഥ ഥ𝒚 − 𝒙𝒚
𝒙
𝒎=
ഥ𝟐 − 𝒙𝟐
𝒙
Examples: obtain fit parameters

3.5

Chart Title
3
4, 3
2.5

2
1, 2
1.5

1
2, 1
0.5

0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5

Ans: y=0.4286x+1
GOODNESS OF FIT?

Y En=yn-(mxn+b) A= residual/unexplained
C=total variation
(xn,yn) B=explained variation
(x2,y2)

E2=y2-(mx2+b) Best fit line y=mx+b


ഥ 𝒍𝒊𝒏𝒆
𝒚
B
C How much % of total variation in Y is
E1=y1-(mx1+b)
A described by the line?
(x1,y1)
(0, b)

X
A=𝑺𝒒𝒖𝒂𝒓𝒆𝒅 𝒆𝒓𝒓𝒐𝒓 𝑺𝑬 𝒍𝒊𝒏𝒆 = 𝒚𝟏 − (𝒎𝒙𝟏 + 𝒃 )𝟐 + 𝒚𝟐 − (𝒎𝒙𝟐 + 𝒃 )𝟐 + … + 𝒚𝒏 − (𝒎𝒙𝒏 + 𝒃 )𝟐
𝑺𝒒𝒖𝒂𝒓𝒆𝒅 𝒆𝒓𝒓𝒐𝒓 𝑺𝑬 𝒍𝒊𝒏𝒆 = 𝒚𝟏 − (𝒎𝒙𝟏 + 𝒃 )𝟐 + 𝒚𝟐 − (𝒎𝒙𝟐 + 𝒃 )𝟐 + … + 𝒚𝒏 − (𝒎𝒙𝒏 + 𝒃 )𝟐

Total in variation in y about the mean is given by:

𝑺𝒒𝒖𝒂𝒓𝒆𝒅 𝒆𝒓𝒓𝒐𝒓 SEഥ 𝒚 )𝟐 + 𝒚𝟐 − (ഥ


𝒚 = 𝒚𝟏 − (ഥ 𝒚 )𝟐 … + 𝒚𝒏 − (ഥ
𝒚 )𝟐 =C

So, what % of total variation is not explained by best fit line? A


= mean squared error;
C
𝑨 B
C
=R2 coeff of
determination
𝑪

Now, what % of total variation is explained by the best fit


line
𝑨 𝑺𝑬 𝑳𝒊𝒏𝒆 Coefficient of determination
𝟏− R 2=1-
𝑪 SE𝒚ഥ Expressed in %
Example on coefficient of determination

Chart Title
4

3
4, 3
2
1, 2
1

0
-3 -2 -1 0 1 2 3 4 5

-1, -1
-1

-2

-2, -3 -3

-4
b) A factory is producing and stockpiling metal sheets to be shipped to an automobile
manufacturing plant. The factory ships only when there is a minimum of 2,050 sheets in stock
at the beginning of that day. The table shows the day, x, and the number of sheets in stock, f
(x), at the beginning of that day.
i. Write a linear regression equation for this set of data and regression coefficient, rounding
coefficients to four decimal places.
Use this equation to determine the day the sheets will be shipped.

Day 1 2 3 4 5 6 7 8
Sheets in 860 930 1000 1150 1200 1360 1440 1600
stock

You might also like