scalaglm

package scalaglm

Type members

Classlikes

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

Generalised linear regression modelling

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
object Glm
Companion
class
sealed trait GlmFamily

Trait for simple one-parameter exponential family observation models.

Trait for simple one-parameter exponential family observation models.

object Irls
case class Lm(y: DenseVector[Double], Xmat: DenseMatrix[Double], colNames: Seq[String], addIntercept: Boolean) extends Model

Linear regression modelling

Linear regression modelling

Value Params
Xmat

Covariate matrix

addIntercept

Add an intercept term to the covariate matrix?

colNames

List of covariate names

y

Vector of responses

Returns

An object of type Lm with many useful attributes providing information about the regression fit

Companion
object
object Lm
Companion
class
case object LogisticGlm extends GlmFamily

GlmFamily object for logistic regression

GlmFamily object for logistic regression

trait Model
case class Pca(mat: DenseMatrix[Double], colNames: Seq[String])

Principal components analysis

Principal components analysis

Computed using SVD of the centred data matrix rather than from the spectral decomposition of the covariance matrix. eg. More like the R function "prcomp" than the R function "princomp".

NOTE: .loadings are transposed relative to the PCA function in Breeze

Value Params
colNames

Sequence of column names of mat

mat

Data matrix with rows corresponding to observations and columns corresponding to variables

Returns

An object of type Pca with methods such as .loadings, .scores, .sdev and .summary

Companion
object
object Pca
Companion
class
case object PoissonGlm extends GlmFamily

GlmFamily object for Poisson regression

GlmFamily object for Poisson regression

trait Predict
case class PredictGlm(mod: Glm, newX: DenseMatrix[Double], response: Boolean) extends Predict

Prediction from a fitted linear (Glm) model

Prediction from a fitted linear (Glm) model

Value Params
mod

fitted generalised linear model

newX

covariate matrix for predictions

response

predictions on the response scale?

Returns

An object of type PredictGlm with several useful attributes, including .fitted and .se

case class PredictLm(mod: Lm, newX: DenseMatrix[Double]) extends Predict

Prediction from a fitted linear (Lm) model

Prediction from a fitted linear (Lm) model

Value Params
mod

fitted linear model

newX

covariate matrix for predictions

Returns

An object of type PredictLm with several useful attributes, including .fitted and .se

object Utils