.Friends, in my previous post, I was thinking about variance of the sum of two random variables. But many friends would find it interesting to find a hermite polynomial series expression for the density of the sum of to random variables that can be used for further analytics. Here I try to write the equations for that.

Suppose our first asset/random variable is [$]Y_1[$] with weight [$]w_1[$] and hermite representation (upto fourth hermite polynomial) of the first asset/random variable is given as

[$]\, Y_1\, = \, a_0 \, + \, a_1 \, Z_1 \, + \, a_2 \, \big[ {Z_1}^2 -1 \big]\, + \, a_3 \, \big[{Z_1}^3 -3 \, Z_1\big]\, + \, a_4 \, \big[{Z_1}^4 \, -3 \, {Z_1}^2 \, +3 \big]\,[$]

our second asset/random variable is [$]Y_2[$] with weight [$]w_2[$] and hermite representation (upto fourth hermite polynomial) of the second asset/random variable is given as

[$]\, Y_2 \, = \, b_0 \, + \, b_1 \, Z_2 \, + \, b_2 \, \big[ {Z_2}^2 -1 \big]\, + \, b_3 \, \big[{Z_2}^3 -3 \, Z_2\big]\, + \, b_4 \, \big[{Z_2}^4 \, -3 \, {Z_2}^2 \, +3 \big]\,[$]

and we want to find hermite series expression for the sum random variable where

[$] \, Y_3 \, = w_1 \, Y_1 \, + \, w_2 \, Y_2 [$]

Let us first describe the hermite form of this summed random variable [$] Y_3[$] and then we would relate its hermite coefficients to hermite coefficients of [$]Y_1[$] and [$]Y_2[$]. This hermite form of [$]Y_3[$] with yet unknown coefficients is given as

[$]\, Y_3 \, = \, c_0 \, + \, c_1 \, Z_3 \, + \, c_2 \, \big[ {Z_3}^2 -1 \big]\, + \, c_3 \, \big[{Z_3}^3 -3 \, Z_3\big]\, + \, c_4 \, \big[{Z_3}^4 \, -3 \, {Z_3}^2 \, +3 \big]\,[$]

Now we write the coefficients of [$]Y_3[$] in terms of coefficients of [$]Y_1[$] and [$]Y_2[$]

Zeroth coefficient is mean in this expansion and is added linearly. Coefficients of higher order hermite polynomials are added in sum squared fashion but accounting for sign.

[$]c_0 \, =\, w_1\, a_0 \, + \,w_2 \, b_0 \,[$]

Expressions below are very simple but since higher hermite coefficients can have both negative and positive signs, you have to be careful in squared sum that when a large negative coefficient is squared and added to a small positive coefficient squared, the result is a smaller negative squared. We take its absolute value, take its squared root and assign it a negative sign.

Please note that coefficient of first hermite polynomial coefficients would almost always be positive. I have never encountered a situation in which coefficient of first hermite polynomial was negative otherwise the derivative of random variable with respect to standard normal will possibly take a negative value which is not allowed for densities. All hermite polynomials after first hermite polynomial can have negative signs for their coefficients.

This is really a simple squared sum but accounting for sign makes the resulting expression a bit complicated.

[$]c_1 \, = \sqrt{ \,{w_1}^2 \, {a_1}^2 \, + \, {w_2}^2 \,{b_1}^2 + \, 2 \, \rho_1 \, w_1 \, w_2 \,a_1 \, b_1} \,[$]

[$]c_2 \, = sgn({sgn(a_2) \,{w_1}^2 \, {a_2}^2 \, + \, sgn(b_2) {w_2}^2 \,{b_2}^2 + \, 2 \, \rho_2 \, w_1 \, w_2 \,a_2 \, b_2}) \\ *\, \sqrt{ |{sgn(a_2) \,{w_1}^2 \, {a_2}^2 \, + \, sgn(b_2) {w_2}^2 \,{b_2}^2 + \, 2 \, \rho_2 \, w_1 \, w_2 \,a_2 \, b_2}|} \,[$]

[$]c_3 \, = sgn({sgn(a_3) \,{w_1}^2 \, {a_3}^2 \, + \, sgn(b_3) {w_2}^2 \,{b_3}^2 + \, 2 \, \rho_3 \, w_1 \, w_2 \,a_3 \, b_3}) \\ *\, \sqrt{ |{sgn(a_3) \,{w_1}^2 \, {a_3}^2 \, + \, sgn(b_3) {w_2}^2 \,{b_3}^2 + \, 2 \, \rho_3 \, w_1 \, w_2 \,a_3 \, b_3}|} \,[$]

[$]c_4 \, = sgn({sgn(a_4) \,{w_1}^2 \, {a_4}^2 \, + \, sgn(b_4) {w_2}^2 \,{b_4}^2 + \, 2 \, \rho_4 \, w_1 \, w_2 \,a_4 \, b_4}) \\ *\, \sqrt{ |{sgn(a_4) \,{w_1}^2 \, {a_4}^2 \, + \, sgn(b_4) {w_2}^2 \,{b_4}^2 + \, 2 \, \rho_4 \, w_1 \, w_2 \,a_4 \, b_4}|} \,[$]

Since a formal expression taking into account signs is unnecessarily complicated, I am writing simpler expression without correlations for friends to gain intuition.

If there are zero correlations between hermite polynomials, we get simpler expressions that are given in case of zero correlations as

[$]c_1 \, =\sqrt{ \,{w_1}^2 \, {a_1}^2 \, + {w_2}^2 \,{b_1}^2 }\,[$]

[$]c_2 \, = sgn(w_1 \,a_2\, + \, w_2 \, b_2) \, \sqrt{ |{sgn(a_2) \,{w_1}^2 \, {a_2}^2 \, + \, sgn(b_2) {w_2}^2 \,{b_2}^2 }|} \,[$]

[$]c_3 \, = sgn(w_1 \,a_3\, + \, w_2\, b_3) \, \sqrt{ |{sgn(a_3) \,{w_1}^2 \, {a_3}^2 \, + \, sgn(b_3) {w_2}^2 \,{b_3}^2 }|} \,[$]

[$]c_4 \, = sgn(w_1 \,a_4\, + \, w_2 \, b_4) \, \sqrt{ |{sgn(a_4) \,{w_1}^2 \, {a_4}^2 \, + \, sgn(b_4) {w_2}^2 \,{b_4}^2 }|} \,[$]

.

Friends, sorry about this above post. Please disregard above post 1785. I confused signs while recalling from a recent case when there where some correlations. The corrected post is given below. Sorry again since many times I write on wilmott, I do not make any notes and write from memory and confused signs with a recent case where there were some correlations.

Friends, in my previous post, I was thinking about variance of the sum of two random variables. But many friends would find it interesting to find a hermite polynomial series expression for the density of the sum of to random variables that can be used for further analytics. Here I try to write the equations for that.

Suppose our first asset/random variable is [$]Y_1[$] with weight [$]w_1[$] and hermite representation (upto fourth hermite polynomial) of the first asset/random variable is given as

[$]\, Y_1\, = \, a_0 \, + \, a_1 \, Z_1 \, + \, a_2 \, \big[ {Z_1}^2 -1 \big]\, + \, a_3 \, \big[{Z_1}^3 -3 \, Z_1\big]\, + \, a_4 \, \big[{Z_1}^4 \, -3 \, {Z_1}^2 \, +3 \big]\,[$]

our second asset/random variable is [$]Y_2[$] with weight [$]w_2[$] and hermite representation (upto fourth hermite polynomial) of the second asset/random variable is given as

[$]\, Y_2 \, = \, b_0 \, + \, b_1 \, Z_2 \, + \, b_2 \, \big[ {Z_2}^2 -1 \big]\, + \, b_3 \, \big[{Z_2}^3 -3 \, Z_2\big]\, + \, b_4 \, \big[{Z_2}^4 \, -3 \, {Z_2}^2 \, +3 \big]\,[$]

and we want to find hermite series expression for the sum random variable where

[$] \, Y_3 \, = w_1 \, Y_1 \, + \, w_2 \, Y_2 [$]

Let us first describe the hermite form of this summed random variable [$] Y_3[$] and then we would relate its hermite coefficients to hermite coefficients of [$]Y_1[$] and [$]Y_2[$]. This hermite form of [$]Y_3[$] with yet unknown coefficients is given as

[$]\, Y_3 \, = \, c_0 \, + \, c_1 \, Z_3 \, + \, c_2 \, \big[ {Z_3}^2 -1 \big]\, + \, c_3 \, \big[{Z_3}^3 -3 \, Z_3\big]\, + \, c_4 \, \big[{Z_3}^4 \, -3 \, {Z_3}^2 \, +3 \big]\,[$]

Now we write the coefficients of [$]Y_3[$] in terms of coefficients of [$]Y_1[$] and [$]Y_2[$]

Zeroth coefficient is mean in this expansion and is added linearly. Coefficients of higher order hermite polynomials are added in sum squared fashion but accounting for sign.

[$]c_0 \, =\, w_1\, a_0 \, + \,w_2 \, b_0 \,[$]

Expressions below are very simple but since higher hermite coefficients can have both negative and positive signs, you have to be careful in squared sum that when a large negative coefficient is squared and added to a small positive coefficient squared, the result is a smaller negative squared. We take its absolute value, take its squared root and assign it a negative sign.

Please note that coefficient of first hermite polynomial coefficients would almost always be positive. I have never encountered a situation in which coefficient of first hermite polynomial was negative otherwise the derivative of random variable with respect to standard normal will possibly take a negative value which is not allowed for densities. All hermite polynomials after first hermite polynomial can have negative signs for their coefficients.

This is really a simple squared sum but accounting for sign makes the resulting expression a bit complicated.

[$]c_1 \, = \sqrt{ \,{w_1}^2 \, {a_1}^2 \, + \, {w_2}^2 \,{b_1}^2 + \, 2 \, \rho_1 \, w_1 \, w_2 \,a_1 \, b_1} \,[$]

[$]c_2 \, = \sqrt{ \,{w_1}^2 \, {a_2}^2 \, + \, {w_2}^2 \,{b_2}^2 + \, 2 \, \rho_2 \, w_1 \, w_2 \,a_2 \, b_2} \,[$]

[$]c_3 \, = \, \sqrt{ \,{w_1}^2 \, {a_3}^2 \, + \, {w_2}^2 \,{b_3}^2 + \, 2 \, \rho_3 \, w_1 \, w_2 \,a_3 \, b_3} \,[$]

[$]c_4 \, =\, \sqrt{ \,{w_1}^2 \, {a_4}^2 \, + \, {w_2}^2 \,{b_4}^2 + \, 2 \, \rho_4 \, w_1 \, w_2 \,a_4 \, b_4} \,[$]

Since a formal expression taking into account signs is unnecessarily complicated, I am writing simpler expression without correlations for friends to gain intuition.

If there are zero correlations between hermite polynomials, we get simpler expressions that are given in case of zero correlations as

[$]c_1 \, =\sqrt{ \,{w_1}^2 \, {a_1}^2 \, + {w_2}^2 \,{b_1}^2 }\,[$]

[$]c_2 \, = \, \sqrt{ \,{w_1}^2 \, {a_2}^2 \, + \, {w_2}^2 \,{b_2}^2 } \,[$]

[$]c_3 \, = \, \sqrt{ \,{w_1}^2 \, {a_3}^2 \, + \, {w_2}^2 \,{b_3}^2 }\,[$]

[$]c_4 \, = \, \sqrt{ {w_1}^2 \, {a_4}^2 \, + \,{w_2}^2 \,{b_4}^2 }\,[$]