Smoothing Serial Data

Download Report

Transcript Smoothing Serial Data

Smoothing Serial Data
300.00
Serial Data
250.00
200.00
150.00
100.00
50.00
0.00
0
2
4
6
8
-50.00

Data collected over time
–
–


longitudinal
serial
Digitized Analog Signals
Data points are not independent
Serial Data
10
12
14
16
18
Smoothing Serial Data:
Moving Average
10
9
8
7
3 point moving average
6
5
4
3
2
1
0
1
2
3
Serial Data
4
5
6
7
8
Simulated Signal

Signal simulated
by sine wave data
produced with
sin() function in
EXCEL
Serial Data
Simulated Noisy Signal

Original
Sinusoid plus
random error
Serial Data
7-point Moving Average


7 adjacent
points are
averaged
Smoothed but
still noisy
Serial Data
21-point Moving Average


Smoother
Amplitude is
reduced
Serial Data
Weighted Moving Averaging


Central points given more importance
Arbitrary weighting scheme
–
e.g 1 3 5 3 1
Serial Data
Weighted Moving Average
e.g. 5 data points
10, 9, 13, 12, 16
average = 12
with a weighting scheme of
13531
weighted average:
= [(1x10)+(3x9)+(5x13)+(3x12)+(1x16)]/13
= 11.8
Mathematical Modeling of Serial Data
Signal Averaging of ECG
ECG + Noise
ECG
Identified QRS Peaks
Serial Data & Modeling
Signal Averaging



(a) (b) and (c) are QRS peak
aligned ECG signal epochs
(d) is the result of averaging
100 such epochs
This works because noise
tends to be random whereas
signal has a consistent
pattern
Mathematical Modeling of Serial Data
Smoothing Serial Data:
Fitting Mathematical Equations



Often used to smooth noisy data
You can find an equation to fit most data
Can also be used for imputing (estimating) missing
values
Serial Data
Mathematical Modeling of Serial Data
Modeling Serial Data

Differs from simple equation fitting in that the
parameters of the equation must have meaning
– Can be used to smooth
– Can explain phenomena
– Can be used to predict
Mathematical Modeling of Serial Data
Steps in Mathematical Modeling




Identification of the mechanism
Translation of that phenomenon into a
mathematical equation
Testing the fit of the model to actual data
Modification of the model according to the
results of the experimental evaluation
Mathematical Modeling of Serial Data
Criteria of Fit of the Model

Least Sum of Squares
Shape of the curve
X Line Fit Plot
250.00
200.00
150.00
Yp

100.00
50.00
0.00
-50.00
0
5
10
-100.00
X
Mathematical Modeling of Serial Data
15
20
Examination of Residuals
Residual = Actual Y - Predicted Y
X Residual Plot
Ideally there is no pattern
to the residuals.
80
60
In this case there would be
a horizontal normal
distribution of residuals
about a mean of zero.
Residuals
40
20
0
-20
0
5
10
-40
-60
X
Mathematical Modeling of Serial Data
15
20
However there is a clear
pattern indicating the lack
of fit of the model.
Ideal Characteristics of a Model



Simple
Fits the experimental data well
Has biologically meaningful parameters
Mathematical Modeling of Serial Data
Modeling Growth Data
Clinical Growth Charts
National Centre for Health
Statistics (N.C.H.S.)1970’s
revamped as
Center for Disease Control
C.D.C. charts, 2001


Most often used
clinical norms for
height and weight
Cross-sectional
Mathematical Modeling of Serial Data
Preece-Baines model I
h  h1 





2(h1  hq )
[ s0 ( t  q )]
e
e
where h is height at time t,
h1 is final height,
s0 and s1 are rate constants,
q is a time constant and
hq is height at t = q.
Mathematical Modeling of Serial Data
[ s1 ( t  q )]
Smooth curves
are the result of
fitting PreeceBaines Model 1
to raw data
This was
achieved using
MS EXCEL
rather than
custom software
Examination of Residuals
Caribbean
Growth
Data
n =1697