11 views

Uploaded by Rianna Cruz

cs131

- Single Regression
- Project Paper Proposal DONE!!!!
- RM Project_TRAINING AND DEVELOPMENT
- Relationships between Hong Kong students’ perceptions of the learning environment and their learning patterns in post-secondary education
- A REVIEW OF THE LITERATURE ON THE PRICE PERFORMANCE OF IPOs
- Lesson 4 Theory
- Multiple Regression Analysis Using SPSS Statistics
- Comparative Analysis of E-commerce Website
- JK Wheat Factors Affecting Paper Dec. 2014
- Lin Reg Assignment
- jurnal baru 1
- Análisis Multivariable
- Johnson-LeBreton ORM 2004
- OSTRAND
- Competences c 3
- word file
- Stepwise Multiple Regression
- Fe Math Review
- Root-Zone Salinity II. Indices for Tolerance in Agricultural Crops
- Numerical Analysis

You are on page 1of 65

LECTURE 3

2/20/16

CHRISTIAN ZUNIGA

MOTIVATION

Data is usually given as a discrete set of values of a continuous domain. One

usual problem that one faces in this situation is when asked to extract data when

no value is given in that point.

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

Curve Fitting

1) Generate a single curve that will follow the pattern taken as a group. Not all

points will be points on the curve.

2) Generate a single curve/or a series of curves that will contain each point of the

group.

2/20/16

CHRISTIAN ZUNIGA

Fit a line, that will best approximate the data set.

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

Regression Coefficient

is at times called the regression coefficient. The closer r it is to 1, the more linear

the data is. r =1 implies that the regression line totally contains all the data set.

2/20/16

CHRISTIAN ZUNIGA

Regression Coefficient

is at times called the regression coefficient. The closer r it is to 1, the more linear

the data is. r =1 implies that the regression line totally contains all the data set.

2/20/16

CHRISTIAN ZUNIGA

Regression Coefficient

is at times called the regression coefficient. The closer r it is to 1, the more linear

the data is. r =1 implies that the regression line totally contains all the data set.

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

Polynomial Regression

We can extend the technique we used in the linear case to derive a formula for

quadratic regression (and for higher order regression)

This involves solving a system of 3 equations and 3 unknowns.

2/20/16

CHRISTIAN ZUNIGA

Polynomial Regression

Find a quadratic formula that can fit the following data.

2/20/16

CHRISTIAN ZUNIGA

Polynomial Regression

2/20/16

CHRISTIAN ZUNIGA

Polynomial Regression

2/20/16

CHRISTIAN ZUNIGA

Polynomial Regression

2/20/16

CHRISTIAN ZUNIGA

Interpolation

Given n+1 points, there exists only one nth degree polynomial that passes

through points. Interpolation is the process of identifying the specific polynomial

that passes through all of the n+1 points.

2/20/16

CHRISTIAN ZUNIGA

Interpolation

Linear

Interpolation: Given the formula for the line containing these two points

is:

2/20/16

CHRISTIAN ZUNIGA

Interpolation

Quadratic Interpolation: The standard form of a quadratic polynomial is:

:

This can be written to:

Where:

2/20/16

CHRISTIAN ZUNIGA

Interpolation

2/20/16

CHRISTIAN ZUNIGA

Interpolation (example)

Find the quadratic function that passes through the following points: -(2,-3), (1,2), (2,-7)

2/20/16

CHRISTIAN ZUNIGA

Interpolation (example)

Find the quadratic function that passes through the following points: -(2,-3), (1,2), (2,-7)

:

This can be written to:

Where:

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

2/20/16

CHRISTIAN ZUNIGA

Simply a reformulation of the Newtons Polynomial that avoids the computation of

the divided differences.

2/20/16

CHRISTIAN ZUNIGA

Lagrange Interpolating

Polynomials

Used for 2 points of data: (xo,f(xo)) and (x1,f(x1)),

x x0

x x1

f1 ( x )

f ( x0 )

f ( x1 )

x0 x1

x1 x0

Lo (x)

L1 ( x)

Second order version (n = 2):

x x1 x x2

f 2 ( x)

f ( x0 )

x0 x1 x0 x 2

x x0 x x2

f ( x1 )

x1 x0 x1 x 2

x x0 x x1

f ( x2 )

x2 x0 x2 x1

Lo ( x) , j 0

L1 ( x) , j 1

L2 ( x) , j 2

Lagrange Interpolating

Polynomials - Example

Use a Lagrange interpolating polynomial of

the first and second order to evaluate ln(2)

on the basis of the data:

x0 1

x1 4

x2 6

f ( x 0) ln(1) 0

f ( x1) ln( 4) 1.386294

f ( x 2) ln(6) 1.791760

Example (contd)

First order polynomial:

x x1

x x0

f 1( x)

f ( x 0)

f ( x1)

x 0 x1

x1 x 0

24

2 1

f 1(2)

0

1.386294 0.4620981

1 4

4 1

Example (contd)

Second order polynomial:

x x1 x x2

x 4 x 6

Lo ( x )

xo x1 xo x2 0 4 0 6

x xo x x2 x 0 x 6

L1 ( x )

x1 xo x1 x2 4 0 4 6

x xo x x1 x 0 x 4

L2 ( x )

x2 xo x2 x1 6 0 6 4

Example (contd)

n

f n ( x ) Li ( x ) f ( xi )

i 0

Li ( x )

j 0

x xj

xi x j

(2 4)( 2 6)

f 2 (2)

0

(1 4)(1 6)

(2 1)( 2 6)

1.386294

(4 1)( 4 6)

(2 1)( 2 4)

1.791760 0.5658444

(6 1)(6 4)

( j i)

Example (contd)

Secret Sharing

An (n, k) secret sharing scheme is a scheme where n people receives a part of a

secret, If atleast k persons agree to share their part of the secret, then the secret

should be easily recovered.

1) Knowledge of less than k shares wont make it easier to determine the original

secret.

2) Knowledge of at least k shares would make it easy to compute/determine the

original secret.

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

8 people

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

6 shares

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

it easier to discover the secret.

Having

any

6

should

make

it

computationally easy to compute for the

secret.

6 shares

2/20/16

CHRISTIAN ZUNIGA

Illustration

A group which has 6 digits can know the

secret.

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

The Trusted Third Party (who

knows the secret d) will generate

a (k-1) degree polynomial whose

constant term is d, i.e.

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

The Trusted Third Party (who

knows the secret d) will generate

a (k-1) degree polynomial whose

constant term is d, i.e.

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

The Trusted Third Party (who

knows the secret d) will generate

a (k-1) degree polynomial whose

constant term is d, i.e.

receives his/her share of the

secret. The TTP will send p(i) to

each of the member (where i is

the members ID)

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

Any 6 people who shares i and p(i)

can reconstruct the polynomial

either using Lagrange Polynomial

or Newtons Polynomial.

2/20/16

CHRISTIAN ZUNIGA

Secret Sharing

New members can easily be

added because the trusted third

party can just generate new

shares

from

the

original

polynomial.

2/20/16

CHRISTIAN ZUNIGA

Spline Interpolation

In the previous section, we fitted n data sets on a

single n-1 degree polynomial.

Spline functions connecting polynomials between

consecutive subsets of point.

2/20/16

CHRISTIAN ZUNIGA

Spline Functions

Usually we use polynomials as spline functions

Easy to evaluate

Easy to differentiate

Easy to integrate

2/20/16

CHRISTIAN ZUNIGA

Linear Splines

Given x0 , y0 , x1 , y1 ,......, x n 1 , y n 1 x n , y n , fit linear splines to the data. This simply involves

forming the consecutive data through straight lines. So if the above data is given in an ascending

order, the linear splines are given by yi f ( xi )

Figure : Linear splines

2/20/16

CHRISTIAN ZUNIGA

Linear Splines

2/20/16

CHRISTIAN ZUNIGA

Linear Splines

The upward velocity of a rocket is given as a function of time in Table 1. Find the

velocity at t=16 seconds using linear splines.

time (s)

0

10

15

20

22.5

30

vel (m/s)

0

227.04

362.78

517.35

602.97

901.67

2/20/16

CHRISTIAN ZUNIGA

Quadratic Splines

Given x0 , y0 , x1 , y1 ,......, x n 1 , y n 1 , x n , y n , fit quadratic splines through the data. The splines

are given by

f ( x ) a1 x 2 b1 x c1 ,

a 2 x 2 b2 x c2 ,

x 0 x x1

x1 x x 2

.

.

.

a n x 2 bn x cn ,

x n1 x x n

2/20/16

CHRISTIAN ZUNIGA

Quadratic Splines

Each quadratic spline goes through two consecutive data points

2

a1 x 0 b1 x 0 c1 f ( x0 )

a1 x12 b1 x1 c1 f ( x1 )

.

.

2

a i xi 1 bi xi 1 ci f ( xi 1 )

2

a i xi bi xi c i f ( xi )

.

.

2

a n x n 1 bn x n1 c n f ( xn 1 )

2

a n x n bn xn cn f ( x n )

This condition gives 2n equations

2/20/16

CHRISTIAN ZUNIGA

Quadratic Splines

The first derivatives of two quadratic splines are continuous at the interior points.

For example, the derivative of the first spline

a1 x 2 b1 x c1 is

2 a1 x b1

a 2 x 2 b2 x c 2 is

2 a2 x b2

2 a1 x1 b1 2a 2 x1 b2

2 a1x1 b1 2a 2 x1 b2 0

2/20/16

CHRISTIAN ZUNIGA

Quadratic Splines

Similarly at the other interior points,

2a 2 x 2 b2 2a3 x 2 b3 0

.

.

.

2ai xi bi 2ai 1 xi bi 1 0

.

.

.

2a n 1 x n 1 bn 1 2a n x n1 bn 0

We have (n-1) such equations. The total number of equations is (2n) (n 1) (3n 1) .

We can assume that the first spline is linear, that is a1 0

2/20/16

CHRISTIAN ZUNIGA

THE UPWARD VELOCITY OF A

ROCKET IS GIVEN AS A

FUNCTION OF TIME. USING

QUADRATIC SPLINES

t

s

0

SECONDS

10

T=16 SECONDS

15

BETWEEN T=11 AND T=16

SECONDS

20

22.5

30

v(t)

m/s

0

227.0

4

362.7

8

517.3

5

602.9

7

901.6

7

t

s

0

10

15

20

22.5

30

v(t)

m/s

0

227.0

4

362.7

8

517.3

5

602.9

7

901.6

7

Solution

2

0 t 10

a 2 t b2 t c 2 , 10 t 15

2

a3t b3t c3 , 15 t 20

2

a 4 t b4 t c 4 , 20 t 22.5

2

a5 t b5 t c5 ,

2

22.5 t 30

Consecutive Data Points

2

a1 (0) b1 (0) c1 0

2

a1 (10) b1 (10) c1 227.04

2

Two Consecutive Data

Points

t

v(t)

2

s

m/s

10

227.04

15

362.78

20

22.5

30

517.35

602.97

901.67

a 2 (15) 2 b2 (15) c 2 362.78

a3 (15) b3 (15) c3 362.78

2

a4 (20) 2 b4 (20) c4 517.35

a4 (22.5) 2 b4 (22.5) c4 602.97

2

2

a 5 (30) b5 (30) c5 901.67

2

Points

v(t ) a1t b1t c1 , 0 t 10

2

a 2 t b2 t c 2 ,10 t 15

2

d

2

a1t b1t c1

dt

t 10

d

2

a2t b2t c2

dt

2a1t b1 t 10 2a2t b2 t 10

2a1 10 b1 2a2 10 b2

20a1 b1 20a2 b2 0

t 10

at Interior Data Points

At t=10

At t=15

At t=20

At t=22.5

Last Equation

a1 0

bcaii

Coefficients of Spline

i

1

2

3

4

5

ai

bi

ci

0

22.704

0

0.8888 4.928 88.88

35.66

0.1356

141.61

1.6048

554.55

33.956

0.2088 28.86

9

152.13

- Single RegressionUploaded byjobert27
- Project Paper Proposal DONE!!!!Uploaded byAzri Alimor
- RM Project_TRAINING AND DEVELOPMENTUploaded byUttam K Sharma
- Relationships between Hong Kong students’ perceptions of the learning environment and their learning patterns in post-secondary educationUploaded bycastorypolux20762
- A REVIEW OF THE LITERATURE ON THE PRICE PERFORMANCE OF IPOsUploaded byZakaria Hegazy
- Lesson 4 TheoryUploaded byuniversoexacto
- Multiple Regression Analysis Using SPSS StatisticsUploaded byAmanullah Bashir Gilal
- Comparative Analysis of E-commerce WebsiteUploaded byTamași-Klaus Adrian
- JK Wheat Factors Affecting Paper Dec. 2014Uploaded byAnonymous n6h0dfMK
- Lin Reg AssignmentUploaded byYusef Vazirabad
- jurnal baru 1Uploaded byaditya kristianto hotama
- Análisis MultivariableUploaded byPedro Jorge Jiménez Prado
- Johnson-LeBreton ORM 2004Uploaded byDaniel Pratama
- OSTRANDUploaded byapi-3738458
- Competences c 3Uploaded byAntonakos Spiros
- word fileUploaded byAkshit Arora
- Stepwise Multiple RegressionUploaded byDwi Endah Kusrini
- Fe Math ReviewUploaded byDuqueCK
- Root-Zone Salinity II. Indices for Tolerance in Agricultural CropsUploaded bylgtsoria
- Numerical AnalysisUploaded byJon West
- LBNA23453ENC_002 JRC Scientific and Technical Reports Water Requirements for Irrigation in the European Union Authors: Gunter Wriedt, Marijn Van der Velde, Alberto Aloe, Fayçal BouraouiUploaded byElisabeta Oprisan
- Hung_Study on displacement prediction of landslide based on neural network.pdfUploaded byPraveen Choudhary
- BANA7038 Chapter 01(3feUploaded byAshish Gupta
- 10520130101003Uploaded byIAEME Publication

- UERM College of MedUploaded byRianna Cruz
- BS ECE ChecklistUploaded byseyren_windsor
- A guideUploaded byErnie Lucero Balagtas Jr.
- UP-CollegeofMed Admission Brochure (2014-2015)Uploaded byDegee O. Gonzales
- Readings on Gay LingoUploaded byRianna Cruz
- BS ECE ChecklistUploaded byseyren_windsor
- UP-CollegeofMed Admission Brochure (2014-2015)Uploaded byDegee O. Gonzales
- A1 - SetsUploaded byIsaac Nicholas Notorio

- Mechanical EnergyUploaded byBlademeister
- Math10 Tg u2Uploaded byRia_Liza_Chico
- Mobile Data Logger and Control SystemUploaded bycandancaner
- Paper Saturation Height MethodsUploaded byjulisarj
- 1317Uploaded bycesardako
- Solution Manual Physics Review QuestionsUploaded byfiruz
- JURNAL 2Uploaded byYunitha
- MATLAB Introduction SlidesUploaded bycustomerx
- physicssolutionsmanual.pdfUploaded bykelectron
- Effect of Speed Limits on Fatalities: Texas Proofing of VehcilesUploaded byvlaxmanan
- Handlg Data Ch3Uploaded bySingh Sudip
- CPS3Uploaded bywrosman@gmail.com
- picket fence labUploaded byapi-236349398
- Matlab Example Lab-1Uploaded byDragan Perisic
- Curve Fitting in ExcelUploaded bymindphaser
- Add Maths FORM 5 (Yearly Planning 2014)Uploaded byberusgigi1
- Spreadsheet Determines Hyperbolic-Decline Parameters - Oil & Gas JournalUploaded byWassef MB
- Logistic Equation Math IAUploaded byAnthony Lu
- Trend Analysis Excel_002-AUploaded byGab
- NC-5-axis productionUploaded byVladimir Magoc
- Comparasion de Metodo EmpiricosUploaded byFelipe Mendoza
- Matlab ApplicationUploaded byGaurav Kumar
- G.pdfUploaded byDivij
- Problem Solving in Chemical Engineering With Matlab[1]Uploaded byweijee
- Excel Link 3 User GuideUploaded byZeljko Ristic
- Optimization techniques - P vs NPUploaded byhammad1122
- Lab 2 Error AnalysisUploaded byAndrew Gomez
- tablecurve2d_5_01_brochure.pdfUploaded byGhasem Bashiri
- Horner PlotUploaded byUriel Alavez
- Prediction of Soil Cutting Forces.Uploaded byŽeljko Livaja