3.2 Approximating Non-Linear Functions

3.2 Approximating
Non-Linear Functions
• linearization by a Taylor's series
approximation
• example using y = e-x
• mean with the linearized equation
• variance with the linearized equation
• a limitation to this approach that is
seldom mentioned in textbooks
• extension to functions of more than one
random variable
• common non-linear functions
3.2 : 1/8
Taylor's Series Linearization
Let ψ(x) be some non-linear function of x. The general idea of a
Taylor's series is to construct a polynomial, φ(x - μx), that
approximates ψ(x) in the vicinity of the mean of the random
variable, μx. The approximating polynomial has the general form,
φ ( x − μ x ) = a0
( x − μ x )0 + a ( x − μ x )1 + a ( x − μ x )2 +"
0!
1
1!
2
2!
where a0 = ψ(μx), a1 = dψ(μx)/dx , a2 = d2ψ(μx)/dx2, etc. With
these values of the ai and keeping x ≈ μx, the approximating
polynomial has the same value, slope, curvature, etc., as the nonlinear ψ(x).
A linear approximation can be written by using the first two terms
of φ(x-μx).
ψ ( x) ≅ φ ( x − μx ) = ψ ( μx ) +
3.2 : 2/8
dψ ( μ x )
dx
( x − μx )
Example Linearization
Consider the non-linear function, ψ(x) = e-x. Develop the linear
approximating function in the vicinity of μx. To do this we need to
use ψ(μx) = exp(-μx), and dψ(μx)/dx = -exp(-μx). The linear
approximation is then given by the following.
ψ ( x ) ≈ e− μ x − e− μ x ( x − μ x ) = (1 + μ x ) e− μ x − e− μ x x
The red line is the
approximation for
μx = 0.5.
The blue line is the
approximation for
μx = 1.5.
ψ(x ), φ (x -μx )
1.25
1
0.75
0.5
0.25
0
0
3.2 : 3/8
0.5
1
1.5
x
2
2.5
3
Moments of the Linearized Function
Rewrite the linearized function so that it has the form a + bx, where
a and b are constants. Remember that μx is a constant!
ψ ( x) ≅ ψ ( μx ) +
dψ ( μ x )
( x − μx )
dx
⎡
dψ ( μ x ) ⎤ ⎡ dψ ( μ x ) ⎤
ψ ( x ) ≅ ⎢ψ ( μ x ) − μ x
⎥+⎢
⎥x
dx ⎦ ⎣ dx ⎦
⎣
The mean of ψ(x) depends upon both the "a" and "b" terms.
⎡
μψ ≅ ⎢ψ ( μ x ) − μ x
⎣
μψ ≅ ψ ( μ x )
dψ ( μ x ) ⎤ ⎡ dψ ( μ x ) ⎤
⎥+⎢
⎥ μx
dx ⎦ ⎣ dx ⎦
The variance depends only upon the "b" term.
⎡ dψ ( μ x ) ⎤ 2
σψ2 ≅ ⎢
⎥ σx
⎣ dx ⎦
2
3.2 : 4/8
Limitation to Linear Moments
ψ (x ), φ (x -μx )
1.25
μx = 1.5
σ = 0.1
σ = 0.2
σ = 0.5
1
0.75
0.5
0.25
0
0
0.5
1
1.5
2
2.5
3
x
It is very important that you estimate the range over which the pdf
of x will spread the measured values. The linear approximation
might work well with one RSD and not another. Data from the σ =
0.1 pdf should satisfy the approximation (RSD = 0.067), while data
from the σ = 0.5 pdf most likely will not (RSD = 0.333).
3.2 : 5/8
Extension to Multiple Variables
Consider a general non-linear function of three independent
random variables, ψ(x,y,z). The first order Taylor's series
expansion is given by the following equation, where μxyz denotes
simultaneous evaluation at all three means, μx, μy, and μz.
ψ ( x ) ≅ ψ ( μ xyz ) +
(
∂ψ μ xyz
∂x
)(x − μ
x
)+
(
∂ψ μ xyz
∂y
)
( y − μy ) +
(
∂ψ μ xyz
∂z
)(z − μ
z
)
The propagation of means yields an anticipated result.
μψ = ψ ( μ xyz )
The propagation of variance yields the equation found in many texts.
(
⎛ ∂ψ μ xyz
2 ⎜
σψ =
∂x
⎜
⎝
3.2 : 6/8
)
2
(
⎞
⎛ ∂ψ μ xyz
2
⎟ σx +⎜
∂y
⎟
⎜
⎠
⎝
)
2
(
⎞
⎛ ∂ψ μ xyz
2
⎟ σy +⎜
∂z
⎟
⎜
⎠
⎝
)
2
⎞
⎟ σ z2
⎟
⎠
Example with Two Variables
The volume of a cylindrical rod is determined by measuring its
diameter and length.
V=
π
4
d 2l
The propagation of precision can be used to determine which
measurement will dominate the variance of the volume.
⎛πd l ⎞ 2 ⎛πd 2 ⎞ 2
=⎜
⎟⎟ σ l
⎟ σ d + ⎜⎜
⎝ 2 ⎠
⎝ 4 ⎠
2
σV2
For a cylinder with a diameter of 1 cm and a length of 10 cm, it can
be seen that the diameter measurement contributes 20 times more to
the volume variance than the length.
2
2
2
2
2 ⎛ 10π ⎞
2 ⎛π ⎞
2 400π
2 π
2
σV = ⎜
σ
σ
σ
σ
+
=
+
d
l
⎟ d ⎜ ⎟ l
16
16
⎝ 2 ⎠
⎝4⎠
3.2 : 7/8
Variance for Common Functions
m
Function
a
z=
x
z = ax 2
z=a x
z = a ln ( x )
z = ae
3.2 : 8/8
x
Variance
Relative Variance
a2
⎛σz ⎞ ⎛σx ⎞
⎟
⎜
⎟ =⎜
μ
⎝ z ⎠ ⎝ μx ⎠
σ z2
=
2
2
σ
x
μ x4
2
2
2
2
2
2
⎛σx ⎞
⎛σz ⎞
4
=
⎜
⎟
⎜
⎟
μ
x
⎝ μz ⎠
⎝
⎠
a2 2
2
σz =
σx
4μ x
⎛σz ⎞
1⎛σx ⎞
=
⎜
⎟
⎜
⎟
4 ⎝ μx ⎠
⎝ μz ⎠
σ z2 = ( 2a μ x ) σ x2
2
σ z2
(
σ z2 = ae μ x
)σ
2
2
⎛σz ⎞
2⎛σx ⎞
=
μ
⎟
⎜
⎟
x⎜
μ
x
⎝ μz ⎠
⎝
⎠
2
x
z = axy
σ z2 = ( aμ y ) σ x2 + ( a μ x ) σ 2y
x
z=a
y
⎛ a
σ z2 = ⎜
⎜ μy
⎝
2
2
2
⎛σz ⎞ ⎛ 1 ⎞ ⎛σx ⎞
⎟⎟ ⎜
⎟
⎜
⎟ = ⎜⎜
μ
⎝ z ⎠ ⎝ ln ( μ x ) ⎠ ⎝ μ x ⎠
⎛ a ⎞ 2
=⎜
⎟ σx
μ
⎝ x⎠
2
2
⎛σx
⎛σz ⎞
⎜
⎟ =⎜
⎝ μz ⎠
⎝ μx
2
⎛σx
⎛σz ⎞
=
⎜
⎜
⎟
⎝ μz ⎠
⎝ μx
2
⎞ 2 ⎛ aμ x ⎞ 2
⎟ σx +⎜ 2 ⎟ σy
⎟
⎜ μy ⎟
⎠
⎝
⎠
2
2
2
2
⎞ ⎛σ y
⎟ + ⎜⎜
⎠ ⎝ μy
2
⎞ ⎛σ y
⎟ + ⎜⎜
⎠ ⎝ μy
2
⎞
⎟
⎟
⎠
2
⎞
⎟
⎟
⎠