Proposition 1.1 De Moargan’s Laws

Download Report

Transcript Proposition 1.1 De Moargan’s Laws

Nonlinear Models
Learning Example: knnl533.sas
Y = relative efficiency of production of a new product
(1/expected cost)
X1: Location
A : X1 = 1, B: X1 = 0
X2 = time (weeks)
n = 30
Learning Example: input
data learning;
infile 'I:\My Documents\Stat 512\CH13TA04.DAT';
input x1 x2 y;
label x1 = 'Location'
x2 = 'Week'
y = 'Efficiency';
proc print data = ch13tab04;
run;
Obs x1 x2
y
1
2
3
4
5
6
7
8
⁞
1 1
1 2
1 3
1 5
1 7
1 10
1 15
1 20
⁞
⁞
0.483
0.539
0.618
0.707
0.762
0.815
0.881
0.919
⁞
Learning Example: Interaction plot
title1 'Plot of the data';
symbol1 v = ‘B' i = none c = blue;
symbol2 v = ’A' i = none c = red;
proc gplot data = learning;
plot y*x2 = x1;
run;
Learning Example: Interaction plot (cont)
Learning Example: Model
proc nlin data = learning method = newton;
parms g0=1.025 g1=-0.0459 g2=-0.5 g3=-0.122 ;
model y = g0 + g1*x1 + g2*exp(g3*x2);
output out = nlinout p = pred;
run;
The NLIN Procedure
Dependent Variable y
Method: Newton
Iterative Phase
Iter
g0
g1
g2
g3 Sum of Squares
0
1.0250 -0.0459 -0.5000 -0.1220
0.0160
1
1.0158 -0.0473 -0.5466 -0.1325
0.00336
2
1.0156 -0.0473 -0.5524 -0.1347
0.00329
3
1.0156 -0.0473 -0.5524 -0.1348
0.00329
NOTE: Convergence criterion met.
Learning Example: Results
Source
DF
Model
3
Error
26
Corrected Total 29
Approx
Sum of Squares Mean Square F Value
Pr > F
0.8634
0.2878 2272.64 <.0001
0.00329
0.000127
0.8667
Parameter Estimate
g0
g1
g2
g3
1.0156
-0.0473
-0.5524
-0.1348
Approx Approximate 95% Confidence
Std Error
Limits
0.00369
1.0080
1.0232
0.00411
-0.0557
-0.0388
0.00825
-0.5694
-0.5355
0.00452
-0.1441
-0.1255
Learning Example: Results (cont)
g0
g1
g2
g3
Approximate Correlation Matrix
g0
g1
g2
g3
1.0000000 -0.5560826 -0.1247886 0.4236608
-0.5560826 1.0000000 0.0000000 0.0000000
-0.1247886 0.0000000 1.0000000 0.5741495
0.4236608 0.0000000 0.5741495 1.0000000
Learning Example: Fitted Data
data nlinout;
set nlinout;
if x1 = 0 then do;
y1 = y;
z21 = x2;
p1 = pred;
end;
if x1 = 1 then do;
y2 = y;
z22 = x2;
p2 = pred;
end;
run;
symbol1 v = 'B' i = none c = blue;
symbol2 v = 'A' i = none c = red;
symbol3 v = none i = join c = blue;
symbol4 v = none i = join c = red;
proc gplot data = nlinout;
plot y1*z21 y2*z22 p1*z21 p2*z22/overlay;
run;
Learning Example: Fitted Data (cont)