Friday, January 20, 2012

Optimization Algorithms

There are many situations in which one needs reliable optimization algorithms to solve econometric and statistical problems. I use them mostly for Maximum Likelihood and Generalized Method of Moments estimations. I find the following algorithms useful, flexible, and very powerful:

NLopt:

NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms. Its features include:
  • Callable from C, C++, Fortran, Matlab or GNU Octave, Python, GNU Guile, and GNU R.
  • A common interface for many different algorithms—try a different algorithm just by changing one parameter.
  • Support for large-scale optimization (some algorithms scalable to millions of parameters and thousands of constraints).
  • Both global and local optimization algorithms.
  • Algorithms using function values only (derivative-free) and also algorithms exploiting user-supplied gradients.
  • Algorithms for unconstrained optimization, bound-constrained optimization, and general nonlinear inequality/equality constraints.
  • Free/open-source software under the GNU LGPL (and looser licenses for some portions of NLopt).

Sunday, January 8, 2012

Macroeconomic Modelling

The following are two excellent tools for macroeconomic modelling:

Macroeconomic Models Data Base: It has more than 50 macroeconomic models that can be computed in Dynare. The project is headed by Volker Wieland, Professor of Monetary Theory and Policy at Goethe University Frankfurt.

DYNARE: "Dynare is a software platform for handling a wide class of economic models, in particular dynamic stochastic general equilibrium (DSGE) and overlapping generations (OLG) models." It is freely available but you have to run it in MATLAB, so, you need MatLab to be installed in your computer first.

Using Dynare to Solve DSGE Models: This is a short tutorial to get started using DYNARE by Eric Sims, University of Notre Dame. He also has nice documentation on estimating RBC and New Keynesian Models here. A similar tutorial can be found here.


Wouter den Haan: Resources for computation of DSGE models.
 

Estimating Volatilities for Portfolio Management

Resources:

Estimating Stock Correlations

R, Matlab, and Gauss Codes

Random collection of codes in R, Matlab, and Gauss for Econometrics and Macroeconomics:
Motohiro Yogo
Serena Ng
Perron
Frank Schorfheide
Frank Schorfheide
Econometric Theory
R in Finance
Econometrics Journal Online
Stochatic Frontier
Stochastic Volatility
Option Pricing
Andrew Patton
Martin Uribe
Judson Caskey (Stata, Matlab, Shumway Hazard Model)
Efficient Method of Moments Matlab
Raymond Kan
University of Zurich
Simone Manganelli
Journal of Financial Economics 
Bayesian VAR
Wouter J. den Haan

Monday, January 2, 2012

A Collection of Article on the U.S. Financial Crisis 2007-2008

"Fire Sales in Finance and Macroeconomics" by Andrei Shleifer and Robert Vishny
On page 39: 
Table 1: A Narrative of the Financial Crisis
1. A housing bubble inflates in the mid 2000s. Homes are financed by mortgages that are increasingly securitized. Although the quality of mortgages deteriorates, the securities into which these
mortgages are packaged are perceived to be safe and receive AAA-ratings.
2. Financial institutions such as banks and dealer banks retain substantial exposure to the real estate  market through direct holdings of commercial real estate and direct holdings of mortgage-backed securities, but also through implicit guarantees of special investment vehicles they organize that  hold mortgage-backed securities and finance them with commercial paper.
3. Bad news about the housing market in the summer of 2007 surprises investors in AAA-rated mortgage-backed securities and precipitates a sequence of substantial disruptions in financial markets, such as the collapse of the asset-backed commercial paper market. Aggressive liquidity interven-tions from the Federal Reserve, including lending to market participants against risky collateral, stabilize markets through the summer of 2008 despite continued bad news about housing.
4. In September 2008, several events, including a run on money market funds, nationalization of AIG, Fannie Mae, and Freddie Mac, and particularly the collapse of Lehman Brothers, precipitate
a massive financial crisis. Banks’ balance sheets contract because of massive losses on assets and withdrawal of short-term financing, which prompts banks to liquidate assets in i re sales. The con-sequences of fire sales are exacerbated by uncertainty about bank solvency and government policy.
5. In response to their losses and to reduced availability of financing, banks cut lending to firms.
6.  The economy slides into a major recession.
7. Starting in October 2008, the government begins massive interventions in financial markets,
including equity injections in banks, expansion of lending against risky collateral, but also direct
purchases of long-term agency bonds, which sharply reduce the supply of risky bonds in the market. The combination of government interventions eventually stabilizes the financial markets by spring 2009, although the real economy remains sluggish.

 

"The Quiet Coup" by Simon Johnson
The crash has laid bare many unpleasant truths about the United States. One of the most alarming, says a former chief economist of the International Monetary Fund, is that the finance industry has effectively captured our government—a state of affairs that more typically describes emerging markets, and is at the center of many emerging-market crises. If the IMF’s staff could speak freely about the U.S., it would tell us what it tells all countries in this situation: recovery will fail unless we break the financial oligarchy that is blocking essential reform. And if we are to prevent a true depression, we’re running out of time. [Continue reading]

Keynes vs Hayek