ln() and product confuse me I have this function: p ( x n </msub> ;

America Ware

America Ware

Answered question

2022-05-20

ln() and product confuse me
I have this function:
p ( x n ; μ ) = 1 ( 2 π ) l 2 | Σ | 1 2 exp ( 1 2 ( x n μ ) T Σ 1 ( x n μ ) )
And I have to compute this: L ( μ ) = ln ( n = 1 N p ( x n ; μ ) ) which should be equal to:
N 2 ln (   ( 2 π ) l | Σ |   )     1 2   n = 1 N ( x n μ ) T Σ 1 ( x n μ )
Note: Σ is a covariance matrix.
From my attempt I have:
1 ( 2 π ) l 2 | Σ | 1 2 = ln 1 ln ( ( 2 π ) l / 2 | Σ | 1 / 2 ) = ln ( ( 2 π ) l / 2 | Σ | 1 / 2 ) = L 2 ln 2 π 1 2 ln | Σ |
and:
ln ( exp ( 1 2 ( x n μ ) T Σ 1 ( x n μ ) ) ) = 1 2 ( x n μ ) T Σ 1 ( x n μ )
but when I put everything together with the product, it doesn't work out, squares appear and it doesn't feel right...Can you help me please understand?

Answer & Explanation

zepplinkid7yk

zepplinkid7yk

Beginner2022-05-21Added 11 answers

We are given that
p ( x n ; μ ) := 1 ( 2 π ) l 2 | Σ | 1 2 exp ( 1 2 ( x n μ ) T Σ 1 ( x n μ ) )
Since p is real valued we should be able to apply ordinary log rules within reason. These are:
1. ln ( x y ) = ln ( x ) + ln ( y ) which generalises to ln ( i x i ) = i ln ( x i ) for finite sums and products.
2. ln ( a b ) = b ln ( a )
3. ln ( exp ( y ) ) = y
Now we want to find:
L ( μ ) = ln ( n = 1 N p ( x n ; μ ) ) = n = 1 N ln ( p ( x n ; μ ) ) using point  1.
Now we find ln ( p ( x n ; μ ) ) :
ln ( p ( x n ; μ ) ) = ln ( ( 2 π ) l / 2 | Σ | 1 / 2 exp ( 1 2 ( x n μ ) T Σ 1 ( x n μ ) ) ) = ln ( [ ( 2 π ) l | Σ | ] 1 / 2 ) + ln ( exp ( 1 2 ( x n μ ) T Σ 1 ( x n μ ) ) ) = 1 2 ln ( ( 2 π ) l | Σ | ) + ( 1 2 ( x n μ ) T Σ 1 ( x n μ ) ) = 1 2 ln ( ( 2 π ) l | Σ | ) 1 2 ( x n μ ) T Σ 1 ( x n μ )
We used points 2 and 3 in going from line 2 to 3 above. Now to do the sum, note the first term doesn't depend on n
n = 1 N ln ( p ( x n ; μ ) ) = n = 1 N [ 1 2 ln ( ( 2 π ) l | Σ | ) 1 2 ( x n μ ) T Σ 1 ( x n μ ) ] = N 2 ln ( ( 2 π ) l | Σ | ) 1 2 n = 1 N ( x n μ ) T Σ 1 ( x n μ )
Which is what you want.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?