Foortran Toolkit

Fortran toolkit
Borja Petit


Download toolkit

Back to index

rouwenhorst_grid and rouwenhorst_transition

subroutine rouwenhorst_grid(n,rho,sigma_e,zgrid)
  implicit none
  integer      , intent(in)  :: n
  real(kind=8) , intent(in)  :: rho,sigma_e
  real(kind=8) , intent(out) :: zgrid(n)

subroutine rouwenhorst_transition(n,rho,pmat)
  implicit none
  integer      , intent(in)  :: n
  real(kind=8) , intent(in)  :: rho
  real(kind=8) , intent(out) :: pmat(n,n)

These subroutines discretize an AR(1) process z' = rho*z + e, with e ~ N(0,sigma_e^2), using the Rouwenhorst method, which is more accurate than tauchen for highly persistent processes.

Internal dependencies: error


Example

  real(kind=8) :: zgrid(7),pmat(7,7)
  call rouwenhorst_grid(7,0.95d0,0.1d0,zgrid)
  call rouwenhorst_transition(7,0.95d0,pmat)