Iskander Karibzhanov

Senior Economist
Bank of Canada
International Modelling Development Division
International Economic Analysis Department
234 Laurier Avenue West
Ottawa, Ontario, Canada
K1A 0G9
E-mail: or
Office number: 613-782-8623

Curriculum Vitae

Work in Progress

A Parallel Implementation of Smolyak Method

In this project, I show how to parallelize popular projection method called Smolyak algorithm involving sparse grids. The main hotspot in projection methods is the evaluation of a large polynomial on a large grid size. Fortunately, this problem turns out to be embarrassingly parallel. My program works in MATLAB by invoking a precompiled CUDA (Compute Unified DeviceArchitecture) kernel function as PTX (parallel thread execution) assembly for NVidia graphical processing units. This allows users to use their existing MATLAB codes without having to translate them into C language. I illustrate the practical application of my method by solving the same international real business cycle model with multiple countries. My algorithm improves performance in double precision by up to 66 times compared with serial implementation in Judd, Maliar, Maliar, and Valero's Smolyak toolbox also written in MATLAB. For example, ten country model with twenty states can be now solved with the third level of approximation in 1 hour on Tesla K20c NVIDIA GPU rather than 70 hours on Intel CPU. (draft, code).

Sovereign defaults in presence of growth shocks

In this paper we investigate sovereign defaults in the presence of temporary and permanent shocks to firms' total factor productivity advocated by Aguiar and Gopinath 2006, JIE. We introduce fluctuations in trend growth to the model of Mendoza and Yue 2012, QJE, to achieve two objectives. First, we want to improve the model's fit of debt-to-GDP ratios in the data. Second, the model will account for default spread dynamics in both emerging and developed economies by allowing for differences in trend growth volatility, as measured by Aguiar and Gopinath 2007, JPE. (draft, slides, code)

International Capital Controls

This paper provides a theoretical support for a macroprudential regulation of capital flows into emerging markets. We study a model of a production economy where private market participants expand the stock of capital during booms and the price of capital rises, enabling them to take on more credit. During busts, the stock of capital becomes less valuable, and the collateral value declines. This leads to a feedback spiral of declining borrowing capacity, falling asset prices, and fire sales. We attribute collateral constraints to be a driving force behind current account reversals and domestic absorption. The paper analyzes the role for macro-prudential policies to lean against the wind when credit flows into the economy. These policies reduce excessive capital creation in booms, and increase social welfare by mitigating the need for fire sales, asset price decline and associated credit crunch in case of a bust. We assess quantitatively that the optimal tax rate on capital inflows should be 1.5%. We find that credit crunches have long-lasting detrimental effects on output due to slow recovery of investment. One implication is that the welfare costs of financial crises are particularly large since they stretch over many periods. This suggests that adding investment channel is important for modelling financial amplification effects. (manuscript, slides, code)

Methods for Estimating Term Structure of Interest Rates

This paper compares different interpolation algorithms for constructing yield curves: cubic splines, linear and quadratic programming, binomial functions and parametric methods. Results confirm that the constrained Schaefer method produces smoother and more stable curves than does unconstrained Schafer's approximation, cubic splines, or discrete approximation. Adding monotonicity constraints in Schaefer method does not increase computational burden as it does in the discrete approximation. My experiments found that adding monotonicity constraints on cubic spline method is unfeasible. I also experimented with three well know parsimonious functional approximations of the term structure: the Nelson-Siegel, Svensson and Bliss exponential functions. Accompanying MATLAB software package illustrates practical application using U.S. treasury bond market data set. (manuscript, code, data)


Cross-country Evidence on the Quality of Fiscal Forecasts, with João Tovar Jalles and Prakash Loungani,
(Journal of Macroeconomics, Vol 45, September 2015, 186–201) (Dataset)

My MATLAB functions

Solving Huggett model using endogenous grid method in CUDA C

Download CUDA C source codes and binaries for Windows and Mac OS X:

To get NVIDIA's CUDA compiler driver, nvcc, download CUDA Toolkit.

A Fortran Toolbox for Solving Bewley Models

  • Solves Huggett model using endogenous grid method. Replicates results of Huggett 1993, JEDC
  • Solves Aiyagari model with CRRA or Epstein-Zin preferences using smart value function iteration method and binary search exploiting monotonicity of policy function and concavity of value function with cubic spline interpolation. Replicates results of Aiyagari 1994, QJE
  • Finds stationary distribution using density function iteration and cumulative distribution function iteration methods
  • Checks mean Euler equation residual on fine grid
  • Computes Lorenz curves, Gini coefficients
  • Approximates univariate AR(1) process by Markov chain:
    • Tauchen method with endogenous grid spread
    • Recursive Rouwenhorst method (superior to Tauchen for persistent processes)
  • Computes Ergodic distribution of Markov chain using eigenvalues of transition matrix
  • Generates grids with linear, power, geometric and logarithmic spacing
Download Fortran source codes and binaries for Windows:

To set up Intel Fortran Compiler to work with Intel MKL libraries in Microsoft Visual Studio 2010 environment, use Linking Advisor.

A Fortran Toolkit for Analyzing Nonlinear Economic Dynamic Models

  • computes 1st order Taylor series approximation to decision rules and puts them in Uhlig notation
  • doesn't require log-linearization, uses numerical derivates instead
  • if analytic log-linearization is specified, it can check for errors with numerical log-linearization
  • solves DSGE models using QZ decomposition
  • computes log-likelihood using Kalman Filter
  • performs maximum likelihood estimation
Download source code and binaries for Windows and Linux: There is a simple example of solving neoclassical growth model in file neo.f90.
Download presentation: toolkit.pdf

The main program that shows all features of toolkit program was based on Ellen McGrattan's paper "Business Cycle Accounting".
Here is an Eviews workfile for the hours worked dataset based on methodology of Prescott-Cociuba-Ueberfeldt. I added first two quaters of 1947 and last quater of 2009. Presentation: bca.pdf

The Kalman Filter

The Kalman filter is one of the computational techniques used by applied economists necessary to implement Bayesian methods when doing empirical work. It provides a tool for dealing with state space models to analyze economic and financial time series of not only correlated its past values but also contemporaneously correlated each other and each other's past values. You can develop a model of the univariate or multivariate time series and the relationships between the vector time series. The program computes the one-step prediction and the filtered estimate, as well as their covariance matrices. The function uses forward recursions, and you can also use it to obtain k-step forecasts.
Overview of Kalman Filter Functions
Getting Started with State Space Models
KALCVF performs covariance filtering and prediction
KALCVS performs fixed-interval smoothing
Kalman Filtering Example 1: Likelihood Function Evaluation
Kalman Filtering Example 2: Estimating an SSM Using the EM Algorithm
Download compiled mex-programs: kalcvf.mexw32 or kalcvf.mexw64 (for Windows) or kalcvf.mexglx (for Linux)
(kalcvs function is presently available only in the form of M-file - see below)
Download M analogies of MEX-files: kalcvf.m and kalcvs.m
Download translated Kalman examples in MATLAB's M scripts: kalex1.m and kalex2.m
Download original Kalman examples in SAS/IML language: and
Download MS Visual Studio 2010 project file:

Solving Linear Rational Expectations Models

C implementation of Chris Sims' solution algorithm for Linear Rational Expectations Models.
The program is based on the Intel Math Kernel Library which provides routines for a complex QZ (generalized Schur) decomposition. (Note: the LAPACK ZGGES routine has advantage over MATLAB's qz built-in function by giving possibility of ordering the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper triangular complex output matrices. Therefore, the algorithm of qzdiv.m and qzswitch.m functions was not neccessary to write gensys program.)
The program analyzes linear rational expectations systems and returns solutions for their dependence on exogenous disturbances. The systems need not have non-singular lead matrices (coefficients on current variables in discrete time) and they need not be well-specified. The program analyzes them to determine whether solutions exist and whether they are unique. It returns a solution even when it is not unique, and it returns a solution that constrains exogenous variable behavior when no solution that does not do so exists. Only discrete time program is currently available.
View manual UsingGensys.pdf
Download program gensys.mexw32 or gensys.mexw64
Download MS Visual Studio 2010 project file:

Unconstrained Minimization Algorithm

C implementation of Chris Sims' robust optimization algorithm commonly used to maximize likelihood function.
The program is based on a gradient quasi-Newton method with BFGS update of the estimated inverse Hessian. It is robust against certain pathologies common on likelihood functions and attempts to be robust against "cliffs", i.e. hyperplane discontinuities, though it is not really clear whether what it does in such cases succeeds reliably. If no analytic gradient is supplied, the program uses crude numerical derivative. Beware of this or any other numerical derivative on large or ill-conditioned problems. The algorithm tries random search directions if things look bad and will not get stuck at a flat spot in the sum of deviations objective function that is not a solution.
Download program csminwel.mexw32 or csminwel.mexw64
Download MS Visual Studio 2010 project file:

Option Pricing Calculators

These European/American and barrier option pricing calculators use enhanced binomial and adaptive mesh methods described in the paper by Figlewski & Gao.
To improve precision increase the number of time steps and/or AMM level.

Download American/European Options Calculator and C source codes
Download Barrier Options Calculator and C source codes