BARS Software

  • BARS code is now available as R packages for Linux and Windows:

    R package for Linux

    R package for Windows

  • Please note: in the windows version the R wrapper line cmdpath <- file.path(pkgpaht,"exec/barsN.out") should be cmdpath <- file.path(pkgpaht,"exec/barsN.exe") [we haven't changed this yet]

    Please address questions to Jeff Liebner ( Help with installation can be found at The Comprehensive R Archive Network.

  • Our paper for the Journal of Statistical Software provides a detailed description of the BARS code.
  • The Poisson version of BARS is also available for Matlab:

    BARS for Matlab

    Questions about the Matlab version should be addressed to Ryan Kelly (

    BARS Publications

    Papers applying (or modifying) BARS include:
  • Behseta, S., Wallstrom, G.L., and Kass, R.E. (2005, Biometrika)
  • Behseta, S. and Kass, R.E. (2005, Statistics in Medicine)
  • Kaufman, C.G., Ventura, V., and Kass, R.E. (2005, Statistics in Medicine)
  • Wallstrom, G., Liebner, J., and Kass, R.E. (2005)
  • Kass, R.E., Ventura, V. and Cai, C. (2003, Network)
  • Wallstrom, G.L, Kass, R.E., Miller, A., Cohn, J.F., and Fox, N.A. (2002, Case Studies in Bayesian Statistics)
  • Dimatteo, I., Genovese, C.R., and Kass, R.E. (2001, Biometrika)
    These may be obtained from my recent publications page.

    About BARS

    BARS (Bayesian Adaptive Regression Splines) solves the generalized nonparametric regression (curve-fitting) problem

Y_i \, & \sim & p(y \vert\theta_i, \zeta) \\
\theta_i & = & f(x_i)

    by assuming the function $f(x)$ may be approximated by a spline. Here, for example, the data $Y_i$ may be binary, or counts, and the explanatory variable $x$ may be time. The special cases in which the data are continuous pose the usual curve-fitting problem, ordinarily solved by some variation on least-squares.

    A substantial literature has demonstrated the power of spline-based generalized curve-fitting. See Hansen and Kooperberg (2002, Statist. Science) for a review. The difficult part of the problem is to allow aspects of the spline to vary (adaptively to the data) across the domain of $x$. DiMatteo, Genovese, and Kass (2001, Biometrika) proposed BARS and contributed an initial implementation and study of the method.


    DiMatteo et al. compared BARS to two recently successful methods of solving the usual curve-fitting problem.

    A typical data set simulated from a true curve, together with fits for each of DMS, SARS, and BARS are shown in the following figure. The fits are all a bit more wiggly than the true curve, but BARS provides a smoother fit while still capturing the sudden jump. Mean-squared errors in several examples were much smaller for BARS than for DMS or SARS.


    The next figure shows a BARS Poisson regression fit (thick curve) to neuronal data, providing the kind of smoothing we believe to be desirable; also shown is a Gaussian kernel density (Gaussian filter) estimate (thin curve). Taken from Kass, Ventura, Cai (2003, NETWORK: Computation in Neural Systems).