conditional forecasts and singular value decomposition
conditional forecasts and singular value decomposition
For a project of mine that produces conditional forecasting with large VARs, out of numerical concerns some readers have asked to see results produced with the algorithm of the following paper: Jarocinski, Marek (2010), "Conditional forecasts and uncertainty about forecast revisions in vector autoregressions," Economics Letters 108, 257-259. Does anyone have code for his algorithm to share? I have the conditional forecast mean piece figured out, using the U, D, and V1 pieces computed with the %svdecomp function in RATS. The piece that seems trickier is the innovation variance piece (for simulation), which uses a matrix V2 that is computed in Jarocinski's version of the SVD but does not get computed (perhaps I am mistaken) in what seems to be the more compact form of the SVD used in the %svdecomp function. Any suggestions would be a great help.
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
Economic Research Dept.
Federal Reserve Bank of Cleveland
Re: conditional forecasts and singular value decomposition
Code: Select all
compute r=%ranmat(15,5)
compute rr=r*tr(r)
compute svd=%svdecomp(rr)
*
* This breaks down the V matrix into the parts associated with the non-zero (V1) and zero (V2) singular values
*
compute [vector] d=svd(2)
sstats 1 %size(d) (abs(d(t))>1.e-12)>>rank
compute irank=fix(rank)
compute [rect] v=svd(3)
compute v1=%xsubmat(v,1,%rows(v),1,irank)
compute v2=%xsubmat(v,1,%rows(v),irank+1,%cols(v))
Re: conditional forecasts and singular value decomposition
Thanks very much, Tom, for the reply and its speed. Sorry, though, that I am still a little confused and stuck as a result. In the Jarocinski approach, he takes the SVD of a matrix R tilde (corresponding to the transpose of the R matrix in your conditional forecast code) that isn't square, having dimension k by q, where q is the number of conditions and k is the total number of forecasts (# horizons by # variables). When I apply the SVD function to this not square matrix, I don't get the columns q+1 through k that are in his V matrix, in those columns (and become V2). The third matrix produced by %svdecomp has dimension k by q --- I only get the stuff corresponding to the q non-zero values. Is there an easy way to get the stuff corresponding to columns q+1 through k of his V matrix?
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
Economic Research Dept.
Federal Reserve Bank of Cleveland
Re: conditional forecasts and singular value decomposition
If you do the %SVDECOMP on the transpose of R-tilde, you get
with the last following because of idempotency. So that becomes the matrix you apply to the normals to get the covariance matrix. The mean part is straightforward.
Re: conditional forecasts and singular value decomposition
Got it -- thanks much, Tom
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
Economic Research Dept.
Federal Reserve Bank of Cleveland