Академический Документы
Профессиональный Документы
Культура Документы
splines
Roger B. Newson
r.newson@imperial.ac.uk
http://www.imperial.ac.uk/nhli/r.newson/
National Heart and Lung Institute
Imperial College London
Frame 1 of 24
Frame 2 of 24
Frame 2 of 24
Frame 2 of 24
Frame 2 of 24
Frame 2 of 24
Frame 2 of 24
Frame 2 of 24
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
3,608
2,992
Frame 3 of 24
2,376
Weight (lbs.)
Graphs by Degree of spline
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Spline models for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
3,608
2,992
Frame 3 of 24
2,376
Weight (lbs.)
Graphs by Degree of spline
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Spline models for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
3,608
2,992
Frame 3 of 24
2,376
Weight (lbs.)
Graphs by Degree of spline
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Spline models for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
3,608
2,992
Frame 3 of 24
2,376
Weight (lbs.)
Graphs by Degree of spline
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Spline models for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
3,608
2,992
Frame 3 of 24
2,376
Weight (lbs.)
Graphs by Degree of spline
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Spline models for mpg with respect to weight in the auto data
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
P
A polynomial model, defined by Y = Kj=0 bj X j , has
semisensible parameters bj , expressed in units such as Yunits
per squared Xunit.
Frame 4 of 24
Frame 5 of 24
Frame 5 of 24
Frame 5 of 24
Frame 5 of 24
Frame 5 of 24
Frame 5 of 24
Frame 5 of 24
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
Frame 6 of 24
3,608
2,992
Weight (lbs.)
Graphs by Degree of spline
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Parameters for splines for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
Frame 6 of 24
3,608
2,992
Weight (lbs.)
Graphs by Degree of spline
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Parameters for splines for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
Frame 6 of 24
3,608
2,992
Weight (lbs.)
Graphs by Degree of spline
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Parameters for splines for mpg with respect to weight in the auto data
Step spline
Linear spline
Quadratic spline
Cubic spline
45
40
35
30
25
20
15
10
5
0
45
40
35
30
25
20
15
10
5
0
4,840
4,224
Frame 6 of 24
3,608
2,992
Weight (lbs.)
Graphs by Degree of spline
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Mileage (mpg)
Parameters for splines for mpg with respect to weight in the auto data
Frame 7 of 24
Frame 7 of 24
Frame 7 of 24
Frame 7 of 24
Frame 7 of 24
Frame 7 of 24
Frame 7 of 24
storage display
value
variable name
type
format
label
variable label
---------------------------------------------------------------------------------------------sp_1
float %8.4f
Spline at 1,760
sp_2
float %8.4f
Spline at 2,376
sp_3
float %8.4f
Spline at 2,992
sp_4
float %8.4f
Spline at 3,608
sp_5
float %8.4f
Spline at 4,224
sp_6
float %8.4f
Spline at 4,840
Note that each reference spline has a variable label, indicating its
reference point on the weight axis.
Frame 8 of 24
Frame 9 of 24
1.
2.
3.
4.
5.
6.
+---------------------------------------------------+
| parm
label
estimate
min95
max95 |
|---------------------------------------------------|
| sp_1
Spline at 1,760
30.43
26.69
34.17 |
| sp_2
Spline at 2,376
24.96
23.37
26.55 |
| sp_3
Spline at 2,992
20.27
18.63
21.91 |
| sp_4
Spline at 3,608
17.54
16.00
19.08 |
| sp_5
Spline at 4,224
15.58
12.76
18.40 |
| sp_6
Spline at 4,840
11.80
6.05
17.55 |
+---------------------------------------------------+
Frame 10 of 24
Frame 11 of 24
Frame 11 of 24
Frame 11 of 24
Frame 11 of 24
Frame 11 of 24
Frame 11 of 24
Spline at 2,376
Spline at 2,992
Spline at 3,608
Spline at 4,224
Spline at 4,840
1
.75
.5
.25
0
1
.75
.5
.25
0
Frame 12 of 24
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Weight (lbs.)
Graphs by Reference spline
Spline at 2,376
Spline at 2,992
Spline at 3,608
Spline at 4,224
Spline at 4,840
1
.75
.5
.25
0
1
.75
.5
.25
0
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Weight (lbs.)
Graphs by Reference spline
Frame 13 of 24
Spline at 2,376
Spline at 2,992
Spline at 3,608
Spline at 4,224
Spline at 4,840
1.25
1
.75
.5
.25
0
.25
.5
1.25
1
.75
.5
.25
0
.25
.5
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Weight (lbs.)
Graphs by Reference spline
These splines are curved and complicated, and less localized than the
previous reference splines. However, each spline is still 1 at its own
reference point, and 0 at all other reference points.
Sensible parameters for polynomials and other splines
Frame 14 of 24
Spline at 2,376
Spline at 2,992
Spline at 3,608
Spline at 4,224
Spline at 4,840
1.25
1
.75
.5
.25
0
.25
.5
.75
1.25
1
.75
.5
.25
0
.25
.5
.75
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
4,840
4,224
3,608
2,992
2,376
1,760
Weight (lbs.)
Graphs by Reference spline
These splines are even more curved and complicated, and even less
localized. However, we still see that each spline is 1 at its own
reference point, and 0 at all other reference points.
Sensible parameters for polynomials and other splines
Frame 15 of 24
Frame 16 of 24
Frame 16 of 24
Frame 16 of 24
Frame 16 of 24
Frame 16 of 24
Frame 16 of 24
Frame 16 of 24
storage display
value
variable name
type
format
label
variable label
---------------------------------------------------------------------------------------------esp_1
byte
%8.4f
Spline at 1,760
esp_2
float %8.4f
Spline at 2,376
esp_3
float %8.4f
Spline at 2,992
esp_4
float %8.4f
Spline at 3,608
esp_5
float %8.4f
Spline at 4,224
esp_6
float %8.4f
Spline at 4,840
Frame 17 of 24
This time, the parameter _cons is the value of the spline at the base
reference weight of 1,760, the parameter esp_1 is omitted because it
corresponds to the base reference weight, and the other spline
parameters are effects on mileage of other reference weights.
Sensible parameters for polynomials and other splines
Frame 18 of 24
1.
2.
3.
4.
5.
6.
7.
+-------------------------------------------------------------------------+
|
parm
label
omit
estimate
min95
max95
p
|
|-------------------------------------------------------------------------|
| o.esp_1
Spline at 1,760
1
0.00
0.00
0.00
.
|
|
esp_2
Spline at 2,376
0
-5.47
-10.07
-0.88
.02
|
|
esp_3
Spline at 2,992
0
-10.16
-13.92
-6.40
9.7e-07 |
|
esp_4
Spline at 3,608
0
-12.89
-17.08
-8.69
5.0e-08 |
|
esp_5
Spline at 4,224
0
-14.85
-19.38
-10.32
9.6e-09 |
|
esp_6
Spline at 4,840
0
-18.63
-25.58
-11.67
1.2e-06 |
|
_cons
Constant
0
30.43
26.69
34.17
4.4e-25 |
+-------------------------------------------------------------------------+
We see that the parameter _cons is the constant term, the omitted
effect of the base weight 1,760 is 0 with both confidence limits 0, and
the effects of the other weights on mileage are clearly significantly
negative.
Sensible parameters for polynomials and other splines
Frame 19 of 24
1,760
2,992
3,608
4,224
4,840
Frame 20 of 24
10
15
20
25
30
Weight (lbs.)
2,376
1,760
2,992
3,608
4,224
4,840
Frame 20 of 24
10
15
20
25
30
Weight (lbs.)
2,376
1,760
2,992
3,608
4,224
4,840
Frame 20 of 24
10
15
20
25
30
Weight (lbs.)
2,376
1,760
2,992
3,608
4,224
4,840
Frame 20 of 24
10
15
20
25
30
Weight (lbs.)
2,376
I
I
Frame 21 of 24
I
I
Frame 21 of 24
I
I
Frame 21 of 24
I
I
Frame 21 of 24
I
I
Frame 21 of 24
I
I
Frame 21 of 24
I
I
Frame 21 of 24
Frame 22 of 24
Frame 22 of 24
Frame 22 of 24
Frame 22 of 24
Frame 22 of 24
Frame 22 of 24
Even
Odd
1,760
2,376
2,992
3,608
4,224
4,840
5
0
5
10
15
20
25
30
35
40
5
0
5
10
15
20
25
30
35
40
These confidence
intervals are from an
equalvariance regression
model, combining weight
as a continuous factor
with oddness as a discrete
factor.
Weight (lbs.)
Frame 23 of 24
Even
Odd
1,760
2,376
2,992
3,608
4,224
4,840
5
0
5
10
15
20
25
30
35
40
5
0
5
10
15
20
25
30
35
40
These confidence
intervals are from an
equalvariance regression
model, combining weight
as a continuous factor
with oddness as a discrete
factor.
Weight (lbs.)
Frame 23 of 24
Even
Odd
1,760
2,376
2,992
3,608
4,224
4,840
5
0
5
10
15
20
25
30
35
40
5
0
5
10
15
20
25
30
35
40
These confidence
intervals are from an
equalvariance regression
model, combining weight
as a continuous factor
with oddness as a discrete
factor.
Weight (lbs.)
Frame 23 of 24
Even
Odd
1,760
2,376
2,992
3,608
4,224
4,840
5
0
5
10
15
20
25
30
35
40
5
0
5
10
15
20
25
30
35
40
These confidence
intervals are from an
equalvariance regression
model, combining weight
as a continuous factor
with oddness as a discrete
factor.
Weight (lbs.)
Frame 23 of 24
References
[1]
Kandel, A. and S. C. Lee. 1979. Fuzzy Switching and Automata: Theory and
Applications. London: Edward Arnold.
[2]
Newson, R. 2000. sg151: B-splines and splines parameterized by their values at reference
points on the x-axis. Stata Technical Bulletin 57: 2027.
[3]
[4]
Frame 24 of 24