## Archive for the ‘**Maximum Likelihood Estimation**’ Category

## Weighted Likelihood for Time-Varying Gaussian Parameter Estimation

In a previous article, we presented a weighted likelihood technique for estimating parameters of a probability density function . The motivation being that for time series, we may wish to weigh more recent data more heavily. In this article, we will apply the technique to a simple Gaussian density

In this case, the log likelihood is given by

Recall that the maximum likelihood occurs when

A simple calculation demonstrates that this occurs when

and

where .

Introducing a weighted expectation operator for a random variable with samples given by

the Gaussian parameters may be expressed in a familiar form via

and

This simple result justifies the use of weighted expectations for time varying Gaussian parameter estimation. As we will see, this is also useful for coding financial time series analysis.

## More fun with maximum likelihood estimation

A while ago, I wrote a post

### Fun with maximum likelihood estimation

where I jotted down some notes. I ended the post with the following:

Note: The first time I worked through this exercise, I thought it was cute, but I would never compute and as above so the maximum likelihood estimation, as presented, is not meaningful to me. Hence, this is just a warm up for what comes next. Stay tuned…

Well, it has been over a year and I’m trying to get a friend interested in MLE for a side project we might work on together, so thought it would be good to revisit it now.

To briefly review, the probability of observing independent samples may be approximated by

where is a probability density and represents the parameters we are trying to estimate. The key observation becomes clear after a slight change in perspective.

If we take the th root of the above probability (and divide by ), we obtain the geometric mean of the individual densities, i.e.

In computing the geometric mean above, each sample is given the same weighting, i.e. . However, we may have reason to want to weigh some samples heavier than others, e.g. if we are studying samples from a time series, we may want to weigh the more recent data heavier. This inspired me to replace with an arbitrary weight satisfying

With no apologies for abusing terminology, I’ll refer to this as the likelihood function

Replacing with would result in the same parameter estimation as the traditional maximum likelihood method.

It is often more convenient to work with log likelihoods, which has an even more intuitive expression

i.e. the log likelihood is simply the weighted (arithmetic) average of the log densities.

I use this approach to estimate stable density parameters for time series analysis that is more suitable for capturing risk in the tails. For instance, I used this technique when generating the charts in a post from back in 2009:

### 80 Years of Daily S&P 500 Value-at-Risk Estimates

which was subsequently picked up by Felix Salmon of Reuters in

### How has VaR changed over time?

and Tracy Alloway of Financial Times in

### On baseline VaR

If I find a spare moment, which is rare these days, I’d like to update that analysis and expand it to other markets. A lot has happened since August 2009. Other markets I’d like to look at would include other equity markets as well as fixed income. Due to the ability to cleanly model skew, stable distributions are particularly useful for analyzing fixed income returns.

## Fun with maximum likelihood estimation

The following is a fun little exercise that most statistics students have probably worked out as a homework assignment at some point, but since I have found myself rederiving it a few times over the years, I decided to write this post for the record to save me some time the next time this comes up.

Given a probability density , we can approximate the probability of a sample falling within a region around the value by

Similarly, the probability of observing independent samples is approximated by

In the case of a normal distribution, the density is parameterized by two parameters and and we have

The probability of observing a given sample is then approximated by

The idea behind maximum likelihood estimation is that the parameters should be chosen such that the probability of observing the given samples is maximized. This occurs when the differential vanishes, i.e.

This, in turn, vanishes only when both components vanish, i.e.

The first component is given by

and vanishes when

The second component is given by

and vanishes when

where .

Note: The first time I worked through this exercise, I thought it was cute, but I would never compute and as above so the maximum likelihood estimation, as presented, is not meaningful to me. Hence, this is just a warm up for what comes next. Stay tuned…