Linear Regression using I-Priors

Provides methods to perform and analyse I-prior regression models. Estimation is mainly done via an EM algorithm, but there is flexibility in using any optimiser.


Based on the manuscript entitled "Objective Bayes regression using I-priors" by Wicher Bergsma [2016, unpublished]. In a linear regression setting, priors can be assigned to the regression function using a vector space framework, and the posterior estimate of the regression function obtained. I-priors are a class of such priors based on the principle of maximum entropy.

This package performs linear regression modelling using I-priors in R. It is intuitively designed to be similar to lm, with both formula and non-formula based input. The parameters of an I-prior model are the scale parameters of the reproducing kernel Hilbert space (RKHS) over the set of covariates, lambda, and the standard deviation of model errors, sigma. While the main interest of I-prior modelling is prediction, inference is also possible, e.g. via log-likelihood ratio tests.

For installation instructions and some examples of I-prior modelling, continue reading below. The package is documented with help files, and the wiki is a good source to view some discussion topics and further examples.

R/iprior makes use of several C++ code, so as a prerequisite, you must have a working C++ compiler. To get it:

  • On Windows, install Rtools.
  • On Mac, install Xcode from the app store.
  • On Linux, sudo apt-get install r-base-dev or similar.

Install R/iprior by downloading the latest CRAN release.

install.packages("iprior")
library(iprior)

If you wish to install the latest developmental release, then you can do so by getting it from this GitHub repository. To do this, you must first install the devtools package.

install.packages("devtools")
library(devtools)

Then, run the following code to install and attach the iprior package.

install_github("haziqjamil/iprior")
library(iprior)

To fit an I-prior model to mod regressing y against x, where these are contained in the data frame dat, the following syntax are equivalent.

mod <- iprior(y ~ x, data = dat)  # formula based input
mod <- iprior(y = dat$y, x = dat$x)  # non-formula based input

The call to iprior() can be accompanied by model options in the form of model = list(), such as choosing the RKHS, number of scale parameters, and others. Control options for the EM algorithm fit is done through the option control = list(). Find the full list of options by typing ?iprior in R.

Visit the the wiki page for some usage examples.

News

v0.6.2

  • Fix for the installation error (#26) on old R releases (prior to 3.3.0). This error was caused by the generic S3 method sigma() not being available from the stats package prior to R v3.3.0.

v0.6.1

  • Several bug fixes and cleanups makes this a CRAN-ready release.

v0.6

  • Added documentation for the package.

v0.5.1

  • Added multi-stage model fitting via kernL().

v0.5

  • Massive improvement to the EM engine which brings about speed improvements.
  • Added a plotting feature.

v0.4.7

  • Bug fixes.

v0.4.6

  • Added support for Fractional Brownian Motion kernel (i.e. smoothing models).

v0.4.5

  • Added the 'predicted log-likelihood feature' in the EM reporting.
  • WARNING: The I-prior package is currently not optimised for large datasets yet. You might encounter debilitating slowness for n > 1000. This is mainly due to the matrix multiplication and data storing process when the EM initialises. See issue #20.

v0.4.4

  • More bug fixes.

v0.4.3

  • Fixed an error in the predict() functionality.

v0.4.2

  • Added progress feedback reporting feature for the EM algorithm.

v0.4.1

  • Improved Pearson kernel generation, but still requires tweaking.

v0.4

  • Added support for Pearson kernels (i.e. regression with categorical variables)

v0.3

  • Major bug fixes.

v0.2

  • Multiple scale parameters supported.

v0.1

  • First useful release.
  • Only centred canonical kernel and a single scale parameter able to be used.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("iprior")

0.6.5 by Haziq Jamil, 4 months ago


https://github.com/haziqjamil/iprior


Report a bug at https://github.com/haziqjamil/iprior/issues


Browse source code at https://github.com/cran/iprior


Authors: Haziq Jamil [aut, cre]


Documentation:   PDF Manual  


GPL (>= 3.0) license


Imports methods, RColorBrewer, Rcpp

Suggests knitr, MASS, rmarkdown, testthat

Linking to Rcpp, RcppEigen


See at CRAN