Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transformations.

Similar presentations


Presentation on theme: "Transformations."— Presentation transcript:

1 Transformations

2 Transformations to Linearity
Many non-linear curves can be put into a linear form by appropriate transformations of the either the dependent variable Y or some (or all) of the independent variables X1, X2, ... , Xp . This leads to the wide utility of the Linear model. We have seen that through the use of dummy variables, categorical independent variables can be incorporated into a Linear Model. We will now see that through the technique of variable transformation that many examples of non-linear behaviour can also be converted to linear behaviour.

3 Intrinsically Linear (Linearizable) Curves
1 Hyperbolas y = x/(ax-b) Linear form: 1/y = a -b (1/x) or Y = b0 + b1 X Transformations: Y = 1/y, X=1/x, b0 = a, b1 = -b

4 2. Exponential y = a ebx = aBx Linear form: ln y = lna + b x = lna + lnB x or Y = b0 + b1 X Transformations: Y = ln y, X = x, b0 = lna, b1 = b = lnB

5 3. Power Functions y = a xb Linear from: ln y = lna + blnx or Y = b0 + b1 X

6 Logarithmic Functions
y = a + b lnx Linear from: y = a + b lnx or Y = b0 + b1 X Transformations: Y = y, X = ln x, b0 = a, b1 = b

7 Other special functions
y = a e b/x Linear from: ln y = lna + b 1/x or Y = b0 + b1 X Transformations: Y = ln y, X = 1/x, b0 = lna, b1 = b

8 Polynomial Models y = b0 + b1x + b2x2 + b3x3 Linear form Y = b0 + b1 X1 + b2 X2 + b3 X3 Variables Y = y, X1 = x , X2 = x2, X3 = x3

9 Exponential Models with a polynomial exponent
Linear form lny = b0 + b1 X1 + b2 X2 + b3 X3+ b4 X4 Y = lny, X1 = x , X2 = x2, X3 = x3, X4 = x4

10 Trigonometric Polynomials

11 b0, d1, g1, … , dk, gk are parameters that have to be estimated,
n1, n2, n3, … , nk are known constants (the frequencies in the trig polynomial. Note:

12 Trigonometric Polynomial Models
y = b0 + g1cos(2pn1x) + d1sin(2pn1x) + … + gkcos(2pnkx) + dksin(2pnkx) Linear form Y = b0 + g1 C1 + d1 S1 + … + gk Ck + dk Sk Variables Y = y, C1 = cos(2pn1x) , S2 = sin(2pn1x) , … Ck = cos(2pnkx) , Sk = sin(2pnkx)

13 Response Surface models
Dependent variable Y and two independent variables x1 and x2. (These ideas are easily extended to more the two independent variables) The Model (A cubic response surface model) or Y = b0 + b1 X1 + b2 X2 + b3 X3 + b4 X4 + b5 X5 + b6 X6 + b7 X7 + b8 X8 + b9 X9+ e where

14

15 The Box-Cox Family of Transformations

16 The Transformation Staircase

17 The Bulging Rule x up y up y down x down

18 Nonlinearizable models
Non-Linear Models Nonlinearizable models

19 Non-Linear Growth models
many models cannot be transformed into a linear model The Mechanistic Growth Model Equation: or (ignoring e) “rate of increase in Y” =

20 The Logistic Growth Model
Equation: or (ignoring e) “rate of increase in Y” =

21 The Gompertz Growth Model:
Equation: or (ignoring e) “rate of increase in Y” =

22 Example: daily auto accidents in Saskatchewan to 1984 to 1992
Data collected: Date Number of Accidents Factors we want to consider: Trend Yearly Cyclical Effect Day of the week effect Holiday effects

23 Trend Yearly Cyclical Trend
This will be modeled by a Linear function : Y = b0 +b1 X (more generally a polynomial) Y = b0 +b1 X +b2 X2 + b3 X3 + …. Yearly Cyclical Trend This will be modeled by a Trig Polynomial – Sin and Cos functions with differing frequencies(periods) : Y = d1 sin(2pf1X) + g1 cos(2pf2X) + d1 sin(2pf2X) + g2 cos(2pf2X) + …

24 Day of the week effect: Holiday Effects
This will be modeled using “dummy”variables : a1 D1 + a2 D2 + a3 D3 + a4 D4 + a5 D5 + a6 D6 Di = (1 if day of week = i, 0 otherwise) Holiday Effects Also will be modeled using “dummy”variables :

25 Independent variables
X = day,D1,D2,D3,D4,D5,D6,S1,S2,S3,S4,S5, S6,C1,C2,C3,C4,C5,C6,NYE,HW,V1,V2,cd,T1, T2. Si=sin( *i*day). Ci=cos( *i*day). Dependent variable Y = daily accident frequency

26 Independent variables
ANALYSIS OF VARIANCE SUM OF SQUARES DF MEAN SQUARE F RATIO REGRESSION RESIDUAL VARIABLES IN EQUATION FOR PACC VARIABLES NOT IN EQUATION STD. ERROR STD REG F PARTIAL F VARIABLE COEFFICIENT OF COEFF COEFF TOLERANCE TO REMOVE LEVEL. VARIABLE CORR. TOLERANCE TO ENTER LEVEL (Y-INTERCEPT ) day E E IACC D Dths D S D S D S D C D V S V S cd S T C C C C C NYE HW T ***** F LEVELS( , ) OR TOLERANCE INSUFFICIENT FOR FURTHER STEPPING

27 Day of the week effects D1 4.99945 D2 9.86107 D3 9.43565 D4 13.84377
D6

28

29 Holiday Effects NYE HW T2

30 Cyclical Effects S1 -7.89293 S2 -3.41996 S4 -3.56763 C1 15.40978 C2
C3 C4 C5

31


Download ppt "Transformations."

Similar presentations


Ads by Google