Friday, July 13, 2012

Progress Report

This blog post is concerned with the milestones achieved and some upcoming features in statsmodels


The model implemented is

y = f(x,θ) + e
where the y is one dimensional endogenous data matrix, f is the nonlinear function, x is exogenous data  matrix, θ is parameter matrix and 'e' is the noise in data. 

The estimation of parameters is done using the 'leastq' method from scipy.optimize which minimizes the sum of squares of residuals. We subclass the model class 'NonlinearLS' and provide the 'expr' function which calculates 'f' in the above expression using the parameter values and exogenous data provided to it. It is encouraged that the user provides the analytical derivative of the given function by defining 'jacobian' function in the similar way as 'expr'.

For testing purposes we used the 'Misra1a' model from NIST data. Details regarding this given in previous post. In summary, we obtained satisfactory results as compared to 'Gretl' which uses the same minpack module used by scipy.

Miscellaneous Features

  • Parameters calculated at each iteration by the algorithm can be viewed using view_iter() method
  • Prediction table with confidence intervals for each predicted value of endogenous data using prediction_table(alpha) method

A complete example can be viewed here

I have been working on the M-estimation of nonlinear models for some time now. The best research paper I found having all the tests, computational algorithm and simulation data is here.
Recently, I have been able to implement the algorithm in my first commit regarding this topic here
Now I am working with testing this model for the 'Numerical example' given in the paper.

No comments:

Post a Comment