Given a model and a prior on the parameters, one can generate a sample using a draw (\theta) from the prior, and compute a statistic vector. This can be done many times, giving many draws of the (\theta, Z) pair.
Using the draws, one can fit the mapping Z->theta using a neural net.
Then, to get an estimate with real data, use the real sample value of Z as the input, and use as the estimator the neural net’s fitted value of theta. Computing this estimator take virtually no time, because the estimator has an analytical expression.
Code which illustrates this is at github.com/mcreel/DSGE_Neural_N … on_Example. A typical estimation using a sample of size 160, with timing, gives
Another run, with different true parameter values is
This code should be completely stand alone, and should run on Octave or Matlab (Dynare is required in either case). If you would like a direct link for a zip file, it’s github.com/mcreel/DSGE_Neural_N … master.zip
Any comments or reports of problems running this with Matlab would be much appreciated!