Hello. The files of interest are ptv.m - contains the conditional test in Polk, Thompson, Vuolteenaho, "Cross-Sectional Forecasts of the Equity Premium." ptvtestcode.m - contains some sample code that randomly generates a data set, calls ptv, and tests several null hypotheses The ptv function syntax is [muhat,Kmathat,sigmahat,tstat,tstatwhite,qvals,pvals,qvalswhite,pvalswhite]=ptv(Y,X,thetanull,tau); INPUTS TO PTV: Y, X are the data. The model is y(t) = mu1 + theta*x(t-1) + e1(t) x(t) = mu2 + rho*x(t-1) + e2(t) e1 and e2 are iid normal with mean zero, and possibly contemporaneously correlated Y is the Tx1 vector Y=(y(1),y(2), ..., y(T))' X is the Tx1 vector Y=(x(1),x(2), ..., x(T))' It is important to note that X and Y are of the same length, and are matched up contemporaneously. The "ptv" function will lag the x's. thetanull is a vector of null hypotheses for theta. So if thetanull = [0;1;2], the function will test the three null hypotheses that theta = 0, theta =1, and theta = 2. Remember the definition of a confidence interval: it is all the nulls we fail to reject. So to form a confidence interval for theta we must test a series of nulls. tau is a quantile of the conditional null distribution. If tau = .95 the function will return the 95% quantile of the conditional null. If tau = .05 the function returns the 5% quantile. OUTPUTS TO PTV: muhat - 2 x 1 matrix, containing estimated values of mu1, mu2. Kmathat - 2 x 2 matrix, element (1,2) is estimate of theta, element (2,2) is estimate of rho. sigmahat - 2 x 2 estimated covariance matrix for errors e1 and e2. tstat - homoskedastic t-stat for each null in thetanull tstatwhite - heteroskedastic t-stat for each null in thetanull qvals - tau quantile for conditional null distributions of homoskedastic t-stats. The conditional null distribution depends on which null we test, so we get a quantile for each null in thetanull. pvals - reports the probability of seeing a homoskedastic t-statistic bigger than the one we saw in the data. For a one-sided test against the alternative theta>thetanull, this is a p-value. qvalswhite - tau quantile for conditional null distributions of heteroskedastic t-stats. The conditional null distribution depends on which null we test, so we get a quantile for each null in thetanull. pvalswhite - reports the probability of seeing a homoskedastic t-statistic bigger than the one we saw in the data. For a one-sided test against the alternative theta>thetanull, this is a p-value. HERE IS AN EXAMPLE of what I get when I run testcode1: >> run ptvtestcode Simulating 600 monthly observations. True parameters: theta is 0, gamma is -0.9, rho is 1. Estimated model: y(t) = -0.0143982 + 0.00646053 * x(t-1) + e1(t) x(t) = 0.0159877 + 0.99021 * x(t-1) + e2(t) Stddev(e1) = 1.06087, Stddev(e2) = 1.07861, Corr(e1,e2) = -0.91259, Testing nulls with homoskedastic tstats Null tstat 0.025 quantile 0.975 quantile -0.050 8.446 0.337 5.404 -0.045 7.698 0.223 5.163 -0.040 6.950 0.101 4.910 -0.035 6.202 -0.028 4.652 -0.030 5.454 -0.163 4.393 -0.025 4.706 -0.302 4.138 -0.020 3.958 -0.442 3.891 -0.015 3.210 -0.582 3.653 -0.010 2.462 -0.719 3.428 -0.005 1.714 -0.852 3.217 0.000 0.966 -0.979 3.020 0.005 0.218 -1.100 2.837 0.010 -0.529 -1.216 2.669 0.015 -1.277 -1.325 2.515 0.020 -2.025 -1.428 2.374 0.025 -2.773 -1.525 2.246 0.030 -3.521 -1.615 2.130 0.035 -4.269 -1.699 2.026 0.040 -5.017 -1.775 1.934 0.045 -5.765 -1.844 1.854 0.050 -6.513 -1.906 1.785 Testing nulls with heteroskedastic tstats Null tstat 0.025 quantile 0.975 quantile -0.050 8.344 0.337 5.404 -0.045 7.605 0.223 5.163 -0.040 6.866 0.101 4.910 -0.035 6.128 -0.028 4.652 -0.030 5.389 -0.163 4.393 -0.025 4.650 -0.302 4.138 -0.020 3.911 -0.442 3.891 -0.015 3.172 -0.582 3.653 -0.010 2.433 -0.719 3.428 -0.005 1.694 -0.852 3.217 0.000 0.955 -0.979 3.020 0.005 0.216 -1.100 2.837 0.010 -0.523 -1.216 2.669 0.015 -1.262 -1.325 2.515 0.020 -2.001 -1.428 2.374 0.025 -2.740 -1.525 2.246 0.030 -3.479 -1.615 2.130 0.035 -4.218 -1.699 2.026 0.040 -4.957 -1.775 1.934 0.045 -5.696 -1.844 1.854 0.050 -6.435 -1.906 1.785 When we test a null of theta = 0, the homoskedastic tstat is 0.966, and the White tstat is 0.955. The 2.5% and 97.5% quantiles of the conditional null distribution are -0.979 and 3.020. Since the t-statistic is inside the 2.5% and 97.5% quantiles of the null distribution, we do not reject the null that theta = 0. To form a confidence interval we test many different nulls for theta. The confidence interval is all the nulls we fail to reject. For the homoskedastic tstat, the confidence interval is [-0.015, 0.015] and for the heteroskedastic tstat it is [-0.015, 0.015]. If you have any questions, send me a message at sthompson@harvard.edu Enjoy. Samuel Thompson, Associate Professor of Economics, Harvard University