Page 1 of 1

Campbell-Ammer (JOF 1993)

Posted: Wed May 05, 2010 10:49 am
by TomDoan
campbellammerjof1993.zip is replication code for Campbell and Ammer(1993), "What Moves the Stock and Bond Markets? A Variance Decomposition for Long-Term Asset Returns", J of Finance, vol 48, pp 3-37, through Table IV. Note that there appears to be an error in the empirical work for the paper in constructing Table IV. (The original paper was done in Gauss, so this is a complete rewrite). This is noted in the comments.

Detailed Description

Re: Campbell-Ammer (JOF 1993)

Posted: Mon Oct 13, 2014 6:56 am
by zoe_z
Hello,

I was wondering if there is anywhere the code available for the paper by Bernanke and Kuttner (2005) "What Explains the Stock Market's Reaction to Federal Reserve Policy?" I have tried to extend the code for Campbell-Ammer (1993) paper provided in this post in order to include the estimation of the monetary policy effects on returns variance components using RATS. I have managed to compute the coefficients of the policy effectiveness correctly; however, I am not sure I applied the delta method to compute the standard errors for the parameters of monetary policy effect in a right way. The code runs but the standard errors are quite big and makes me wonder that something was missed by me in the coding part (I use numerical derivatives instead of the true delta method as in the original RATS code).

In this case, the monetary policy impact coefficients are also non-linear functions of VAR coefficients and parameter phi that is estimated using the VAR residual vector (residual vector is regressed on monetary policy variable).
I was wondering if you could kindly have a look into the technical side of the extension? I attach the code.

Your help is much appreciated.
Thank you!

Re: Campbell-Ammer (JOF 1993)

Posted: Wed Oct 15, 2014 7:53 pm
by TomDoan
It looks fine. The doubly nested ranges looks a bit odd---you estimate the same full sample VAR through each of the ranges in the outer loop. It would make more sense to eliminate the "inner" loop that doesn't loop, but that doesn't appear to affect the results. The phi's are "statistics", not free parameters, so they have no effect on the distribution of the other statistics.

Re: Campbell-Ammer (JOF 1993)

Posted: Mon Apr 18, 2016 2:28 pm
by tomemmerling
Dear All,
Tom, thank you for posting the replication code for this paper. While reading through the code, I ran into a couple of quick questions for this discussion board. First, in Table IV on the rrevise computation lines (both the correct and mistaken code lines), why isn't the right hand side multiplied by 1.0/12.0 as in Table III. The data appears to be the annual real interest rate which is why 1.0/12.0 is used to correctly generate Table III. Just wondering why it doesn't appear in Table IV. Perhaps I'm misinterpreting the real interest rate data values. Second, a conceptual question, why does the right-hand side of fiddle multiply by .0001? I'm certainly not questioning the veracity, just looking for a quick explanation. Perhaps someone could briefly explain to me the statistic (stat-basestat)/fiddle used for the delta method to determine the standard error of the variance ratios in Tables III, IV? Thanks.

Re: Campbell-Ammer (JOF 1993)

Posted: Thu Nov 07, 2024 11:05 am
by TomDoan
tomemmerling wrote:Dear All,
Tom, thank you for posting the replication code for this paper. While reading through the code, I ran into a couple of quick questions for this discussion board. First, in Table IV on the rrevise computation lines (both the correct and mistaken code lines), why isn't the right hand side multiplied by 1.0/12.0 as in Table III. The data appears to be the annual real interest rate which is why 1.0/12.0 is used to correctly generate Table III. Just wondering why it doesn't appear in Table IV. Perhaps I'm misinterpreting the real interest rate data values.
Remember that we didn't write the paper. The authors use a combination of monthly and annual returns, and you would probably have to ask them which they use and why.
tomemmerling wrote: Second, a conceptual question, why does the right-hand side of fiddle multiply by .0001? I'm certainly not questioning the veracity, just looking for a quick explanation. Perhaps someone could briefly explain to me the statistic (stat-basestat)/fiddle used for the delta method to determine the standard error of the variance ratios in Tables III, IV? Thanks.
That's not conceptual---it's operational. The authors used analytical derivatives in applying the delta method. Those are staggeringly complicated with those matrix power functions and aren't easy to extend to other similar calculations. I used numerical derivatives instead which give effectively identical results while requiring only that you're able to write the basic calculation and not its derivatives. How the numerical derivatives are done are covered in the comments in the Table III loop:

Code: Select all

   *
   * Compute numerical derivatives of the NSTATS statistics with respect
   * to the VAR parameters.
   *
   dim statderive(nstats,ncoeffs)
   do calc=0,ncoeffs
      if calc==0 {
         *
         * CALC==0 is the initial pass which computes everything at the
         * OLS VAR estimates. XXFULL is the system robust covariance
         * matrix for the VAR estimates.
         *
         estimate(resids=u,coeffs=betafull,noprint) ranges(range,1) ranges(range,2)
         mcov(equation=%modeleqn(onelag,1),nodepvar) ranges(range,1) ranges(range,2) u
         compute xxfull=%mqform(%cmom,%kroneker(%identity(nvar),%xx))
      }
      else {
         *
         * Perturb coefficient "calc" from the OLS coefficients by .0001
         * times the robust standard error estimate.
         *
The .0001 x the robust standard error estimate of the coefficient allows for scale-dependent "fiddles". If you just use a hard "h" of say .000001 it might be too small to actually change the function value if the parameter to which it's applied is measured in a big scale (1000's for instance), and might be too large to be local if it's itself measured in small decimals.