statistics-0.13.2.1: A library of statistical types, data, and functions

Safe HaskellNone

Statistics.Regression

Description

Functions for regression analysis.

Synopsis

Documentation

olsRegressSource

Arguments

:: [Vector]

Non-empty list of predictor vectors. Must all have the same length. These will become the columns of the matrix A solved by ols.

-> Vector

Responder vector. Must have the same length as the predictor vectors.

-> (Vector, Double) 

Perform an ordinary least-squares regression on a set of predictors, and calculate the goodness-of-fit of the regression.

The returned pair consists of:

  • A vector of regression coefficients. This vector has one more element than the list of predictors; the last element is the y-intercept value.
  • R², the coefficient of determination (see rSquare for details).

olsSource

Arguments

:: Matrix

A has at least as many rows as columns.

-> Vector

b has the same length as columns in A.

-> Vector 

Compute the ordinary least-squares solution to A x = b.

rSquareSource

Arguments

:: Matrix

Predictors (regressors).

-> Vector

Responders.

-> Vector

Regression coefficients.

-> Double 

Compute R², the coefficient of determination that indicates goodness-of-fit of a regression.

This value will be 1 if the predictors fit perfectly, dropping to 0 if they have no explanatory power.

bootstrapRegressSource

Arguments

:: GenIO 
-> Int

Number of resamples to compute.

-> Double

Confidence interval.

-> ([Vector] -> Vector -> (Vector, Double))

Regression function.

-> [Vector]

Predictor vectors.

-> Vector

Responder vector.

-> IO (Vector Estimate, Estimate) 

Bootstrap a regression function. Returns both the results of the regression and the requested confidence interval values.