Glm

case class Glm(y: DenseVector[Double], Xmat: DenseMatrix[Double], colNames: Seq[String], fam: GlmFamily, addIntercept: Boolean, its: Int) extends Model

Generalised linear regression modelling

Value Params
Xmat

Covariate matrix

addIntercept

Add an intercept term to the covariate matrix?

colNames

List of covariate names

fam

Observation model. eg. LogisticGlm or PoissonGlm

its

Max iterations for the IRLS algorithm (default 50)

y

Vector of responses

Returns

An object of type Glm with many useful methods providing information about the regression fit, including .coefficients, .p and .summary

Companion
object
trait Serializable
trait Product
trait Equals
trait Model
class Object
trait Matchable
class Any

Value members

Concrete methods

def plots: Figure
def predict(newX: DenseMatrix[Double], response: Boolean): PredictGlm

Predictions for a new matrix of covariates

Predictions for a new matrix of covariates

Value Params
newX

New matrix of covariates

response

Fitted values on the scale of the response?

Returns

Prediction object

def summary: Unit

Prints a human-readable regression summary to the console

Prints a human-readable regression summary to the console

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Concrete fields

val X: DenseMatrix[Double]

Design matrix (including the intercept column, if required)

Design matrix (including the intercept column, if required)

val coefficients: DenseVector[Double]

Fitted regression coefficients

Fitted regression coefficients

lazy val df: Int

Degrees of freedom

Degrees of freedom

lazy val fitted: DenseVector[Double]
val irls: (DenseVector[Double], DenseMatrix[Double], DenseMatrix[Double])

Tuple containing results of running the IRLS algorithm - not for general use

Tuple containing results of running the IRLS algorithm - not for general use

lazy val n: Int

Number of observations

Number of observations

val names: Seq[String]

Sequence of variable names (including the intercept)

Sequence of variable names (including the intercept)

lazy val p: DenseVector[Double]

p-values for the regression coefficients

p-values for the regression coefficients

lazy val pp: Int

Number of variables (including the intercept)

Number of variables (including the intercept)

val q: DenseMatrix[Double]

Final Q-matrix from the IRLS algorithm

Final Q-matrix from the IRLS algorithm

val r: DenseMatrix[Double]

Final R-matrix from the IRLS algorithm

Final R-matrix from the IRLS algorithm

lazy val ri: DenseMatrix[Double]

Inverse of the final R-matrix

Inverse of the final R-matrix

lazy val se: DenseVector[Double]

Standard errors for the regression coefficients

Standard errors for the regression coefficients

lazy val z: DenseVector[Double]

z-statistics for the regression coefficients

z-statistics for the regression coefficients