SimpleRegression

scalation.modeling.SimpleRegression
See theSimpleRegression companion class

The SimpleRegression companion object provides a simple factory method for building simple regression linear regression models.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(xy: MatrixD, fname: Array[String]): SimpleRegression

Create a Simple Linear Regression model from a combined data matrix. The first column of matrix xy should have all ones corresponding to the intercept (matrix from has two column vectors [1 x]). Take the first two columns for the predictor and the last column for the response.

Create a Simple Linear Regression model from a combined data matrix. The first column of matrix xy should have all ones corresponding to the intercept (matrix from has two column vectors [1 x]). Take the first two columns for the predictor and the last column for the response.

Value parameters

fname

the feature/variable names (defaults to null)

xy

the combined data matrix

Attributes

See also

SimplerRegression for a model without an intercept parameter

def apply(x: VectorD, y: VectorD, fname: Array[String]): SimpleRegression

Create a Simple Linear Regression model by automatically prepending the column of ones (form matrix from two column vectors [1 x]).

Create a Simple Linear Regression model by automatically prepending the column of ones (form matrix from two column vectors [1 x]).

Value parameters

fname

the feature/variable names

x

the data/input m-by-1 vector

y

the response/output m-vector

Attributes

def best(x: MatrixD, y: VectorD, fname: Array[String]): SimpleRegression

Create the Best Simple Linear Regression model using the first column of all ones and the column/variable that is the best predictor xj (matrix [1 xj]). Caveat: assumes matrix x has a first column of all one.

Create the Best Simple Linear Regression model using the first column of all ones and the column/variable that is the best predictor xj (matrix [1 xj]). Caveat: assumes matrix x has a first column of all one.

Value parameters

fname

the feature/variable names (defaults to null)

x

the m-by-n data/input matrix

y

the response/output m-vector

Attributes

def coeff(x: VectorD, y: VectorD): VectorD

Compute the SimpleRegression coefficients directly from the x and y vectors.

Compute the SimpleRegression coefficients directly from the x and y vectors.

Value parameters

x

the data/input m-vector

y

the response/output m-vector

Attributes

def quadratic(x: VectorD, y: VectorD, fname: Array[String]): SimpleRegression

Create a Simple Linear Regression model quadratic in x by automatically prepending the column of ones (form matrix from two column vectors [1 x^2]).

Create a Simple Linear Regression model quadratic in x by automatically prepending the column of ones (form matrix from two column vectors [1 x^2]).

Value parameters

fname

the feature/variable names (defaults to null)

x

the data/input m-by-1 vector (to be squared)

y

the response/output m-vector

Attributes