Professional Documents
Culture Documents
Harikripal
10/07/2018
1 Introduction
The objective of the project is to study on the delivery time using the data
given on the vending machine service routes.The project is a regression based
study focused on predicting the optimum delivery time.
1
n n n n n
βˆ0 xik + βˆ1 xik xi1 + βˆ2 xik xi2 + ...βˆk x2ik =
P P P P P
xik yi (5)
i=1 i=1 i=1 i=1 i=1
The solution of the above equations will be the least-square estimators βˆ0 , βˆ1 ...βˆk .
It is more convenient to deal with multiple regression model if they are expreesed
in matrix notation.It allows a very compact display of the model data and re-
sults.In matrix notation the model given by equation (1) is
y =Xβ +
y1 1 x11 x12 . . . x1k
y2 1 x21 x12 . . . x2k
. .
y=
,X= .
.
. .
yn 1 xn1 xn2 . . . xnk
β1 1
β2 2
. .
β=
, = .
.
. .
βk n
In general y is an n × 1 vector of the observations,x is an n × p matrix of the
level of the regressor variables,β is a p × 1vector of the regression coefficients
,and is an n × 1 vector of random errors.
We are looking for finding the vector of least square estimators β∗ that mini-
mizes
n
21 = 0 = (y − Xβ)0 (y − Xβ)
P
S(β) =
i=1
We can express S(β) as S(β) = y 0 y − β 0 X 0 Y − Y 0 Xβ + β 0 X 0 Xβ
= Y 0 Y − 2β 0 X 0 Y + β 0 X 0 Xβ
sinceβ’X’Y is a 1 × 1 matrix or a scalar,and its transpose(β 0 X 0 Y )0 = Y 0 Xβ
his the
i same scalar.The least square estimator must satisfy
∂S
∂β =-2X’Y+2X’Xβ = 0
β̂
X 0 Xβ = X 0 Y (6)
equation (6) are the least-square normal equations.
Now we solve the normal equations,multiply both sides of (6) by (X 0 X)− 1.Now
OLS of β is
β̂ = (X 0 X)− 1X 0 Y (7)
Provided that the inverse matrix(X 0 X)1 exists.The(X 0 X)1 1 will always exist if
the regressors are linearly in dependent.that is if no coloum of the X matrix is
a linear combination of other coloumns.
Now we see the matrix form of (7) in detail,we obtain.
2
n
P n
P n
P
yi n xi1 . . . xik
i=1 i=1 i=1 β0
n x y n x n n
β1
P P
x2i1
P P
i1 i i1 . . . xi1 xik
β2
i=1 i=1 i=1 i=1
. = . .
. . .
. . .
n n n n
P
xik yi
P
xik
P
xi1 xik . . .
P
x2ik
βk
i=1 i=1 i=1 i=1
3
Observation Deliverytime N umberof Distance ŷi ei = yi − ŷi
N umber (minutes) casesx1 x2 (f eet)
To fit the multiple regression model we first form the X matrix and y vector
1 1 1 . . . . 1 1
X’= 7 3 3 . . . . 8 4
560 220 340 . . . . 635 150
Y’= 16.68 11.50 12.03 . . . . 19.83 10.75
The X’X matrix is
1 7 560
1 1 1 . . . . 1 1
1 3 220
X’X= 7 3 3 . . . . 8 4
. . .
560 220 340 . . . . 635 150 . . .
1 4 150
25 219 10, 232
= 219 3055 133, 899
10, 232 133, 899 6, 725, 688
and the X’y vector is
4
16.68
1 1 1 . . . . 1 1 11.50
X’y= 7 3 3 . . . . 8 4
. . .
560 220 340 . . . . 635 150 . . .
10.75
559.60
= 7375.44
337072.00
The least square estimator of β is β̂ = (X 0 X)( − 1)X 0 y
ˆ
β0
βˆ1
βˆ2
1
25 219 10232 559.60
= 219 3055 133899 7375.44
10232 133899 6, 725688 337072.00
.11321518 −.004444859 −.00008367 559.60
= −.00444859 0.002744378 −.00004786 7375.44
−.00008367 −.00004786 .00000123 337072.00
ˆ
β0 2.34123115
βˆ1 = 1.61590712
βˆ2 0.01438483
The least-squares fit(with the regression coefficients reported to five decimal) is
ŷ = 2.34123 + 1.61591x1 + 0.01438x2
3 ANALYSIS OF VARIANCE
:
SU M OF M EAN
SOU RCE DF SQU ARES SQU ARE F V ALU E P ROB F
4 PARAMETER ESTIMATES
:
T FOR Ho:
5
P ARAM ET ER ST AN DARD P ARAM ET ER P ROB V ARIAN CE
V ARIABLE DF EST IM AT E ERROR =0 |T | IN F LAT ION
IN T ERCEP 1 2.34123115 1.09673017 2.135 0.0442 0
CASES 1 1.61590721 0.17073492 9.464 0.0001 3.11841
DIST AN CE 0.01438483 0.003613086 3.981 0.0006 3.11841
5 RESULT
:-There is a positive relationship of delivery time with number of cases and
distance.
5.1.1 Spaces
paragraph space for me
6 Math Mode
6.1 Active Character
\
ˆ
˜
6
6.3 Subscript and Superscript
f (x) = a3 x3 + a2 x2 + a1 x + a0 = 0
7 Greek Letters
surface area of sphere 4πr2
Alpha-α
Beta-β
Gamma-γ
Delta- δ η θ κ λ µ ν ρ σ φ τ ω
± · × ∗ ◦ ÷ ≤≥≡∼⊥6<6≈→*
PR H
Γ h̄ ∂ ∞ 0 ∇ 4 \ ♣ ♥ ♠ ♦ )
8 Standard Functions
sin
arcsin
exp
ln
lim
log
9 Fractions
numerator
denominator
10 nth root
√
5 xyz
11 Ellipsis
f 0(x1 , . . . , xn ) = 1 + 2 + 2 + · · · + 5
12 Accents
~r
r̄
r̃
r̂
7
13 Homework
13.1 Example 1
roots of the quadratic equation αx2 + βx + γ = 0 is
The √
2
−β± β 2 −4αγ
2α
13.2 Example 2
tanx
lim x =1
x→0
limx→0 tanx
x =1
13.3 Example 3
" #
∂
R
b
1
Rb Rb
∂a f (x)dx = lim f (x)dx − f (x)dx
a ∆a→0 ∆a a+∆a
a
13.4 Example 4
The cross product for two vectors,
~a = a1 î + a2 ĵ + a3 k̂ and
~b = b1 î + b2 ĵ + b3 k̂ can be written as
î ĵ k̂
~a × ~b = a1
a2 a3
b1 b2 b3
14 Euations
1
s = ut + at2 (3)
2
a = b (4)
= y (5)
a = c
= z
a=b+c