shared3p_statistics_glm.sc

shared3p_statistics_glm.sc

Module for performing regression analysis of generalized linear models.

Functions:

GLMAIC

Compute the Akaike information criterion of a generalized linear model.

Detailed Description

D - shared3p protection domain

Supported types - int32 / int64 / float32 / float64

Parameters

dependent

- dependent variable

glm

- structure returned by the model fitting function

Akaike information criterion

None

Function Overloads

D float32 GLMAIC(D int32[[1]] dependent, GLMResult< D, float32 > glm)

D float64 GLMAIC(D int64[[1]] dependent, GLMResult< D, float64 > glm)

D float32 GLMAIC(D float32[[1]] dependent, GLMResult< D, float32 > glm)

D float64 GLMAIC(D float64[[1]] dependent, GLMResult< D, float64 > glm)

GLMAIC(direct)

Compute the Akaike information criterion of a generalized linear model.

Detailed Description

D - shared3p protection domain

Supported types - int32 / int64 / float32 / float64

Parameters

dependent

- dependent variable

vars

- independent variables (each column is a variable)

coefficients

- model coefficients

family

- indicates the distribution of the dependent variable

Akaike information criterion

None

Function Overloads

D float32 GLMAIC(D int32[[1]] dependent, D int32[[2]] vars, D float32[[1]] coefficients, int64 family)

D float64 GLMAIC(D int64[[1]] dependent, D int64[[2]] vars, D float64[[1]] coefficients, int64 family)

D float32 GLMAIC(D float32[[1]] dependent, D float32[[2]] vars, D float32[[1]] coefficients, int64 family)

D float64 GLMAIC(D float64[[1]] dependent, D float64[[2]] vars, D float64[[1]] coefficients, int64 family)

constants

constants

Constants

GLM_FAMILY_GAUSSIAN = 0

int64

GLM_FAMILY_BINOMIAL_LOGIT = 1

int64

GLM_FAMILY_GAMMA = 2

int64

GLM_FAMILY_POISSON = 3

int64

GLM_SOLE_METHOD_INVERT = 0

int64

GLM_SOLE_METHOD_LU_DECOMPOSITION = 1

int64

GLM_SOLE_METHOD_GAUSS = 2

int64

GLM_SOLE_METHOD_CONJUGATE_GRADIENT = 3

The "family" constants are used to specify the distribution of the dependent variable. The "SOLE method" constants specify the algorithm used to solve systems of linear equations.

generalizedLinearModel

Fitting of generalized linear models.

Detailed Description

D - shared3p protection domain

Supported types - int32 / int64 / float32 / float64

You can pass an empty matrix as the variables argument to specify a null model with just intercept.

Parameters

dependent

- sample vector of the dependent variable

variables

- a matrix where each column is a sample of an explanatory variable

family

- indicates the distribution of the dependent variable

iterations

- number of iterations of the GLM algorithm

GLMResult structure

None

Function Overloads

generalizedLinearModel(D int32[[1]] dependent, D int32[[2]] variables, int64 family, uint iterations)

generalizedLinearModel(D int64[[1]] dependent, D int64[[2]] variables, int64 family, uint iterations)

generalizedLinearModel(D float32[[1]] dependent, D float32[[2]] variables, int64 family, uint iterations)

generalizedLinearModel(D float64[[1]] dependent, D float64[[2]] variables, int64 family, uint iterations)

generalizedLinearModel(with method parameter)

Fitting of generalized linear models.

Detailed Description

D - shared3p protection domain

Supported types - int32 / int64 / float32 / float64

You can pass an empty matrix as the variables argument to specify a null model with just intercept.

Parameters

dependent

- sample vector of the dependent variable

variables

- a matrix where each column is a sample of an explanatory variable

family

- indicates the distribution of the dependent variable

iterations

- number of iterations of the GLM algorithm

SOLEmethod

- method to use for solving systems of linear equations

SOLEiterations

- if the conjugate gradient method is used for solving systems of linear equations, this parameter is the number of iterations to use

returns GLMResult structure

None

Function Overloads

generalizedLinearModel(D int32[[1]] dependent, D int32[[2]] variables, int64 family, uint iterations, int64 SOLEmethod, uint SOLEiterations)

generalizedLinearModel(D int64[[1]] dependent, D int64[[2]] variables, int64 family, uint iterations, int64 SOLEmethod, uint SOLEiterations)

generalizedLinearModel(D float32[[1]] dependent, D float32[[2]] variables, int64 family, uint iterations, int64 SOLEmethod, uint SOLEiterations)

generalizedLinearModel(D float64[[1]] dependent, D float64[[2]] variables, int64 family, uint iterations, int64 SOLEmethod, uint SOLEiterations)

glmStandardErrors

Estimate the standard errors of coefficients of generalized linear models.

Detailed Description

D - shared3p protection domain

Supported types - int32 / int64 / float32 / float64

Parameters

dependent

- sample vector of dependent variable

variables

- a matrix where each column is a sample of an explanatory variable

coefficients

- coefficients estimated by the GLM fitting procedure

family

- indicates the distribution of the dependent variable

returns a vector with the standard errors of each coefficient

None

Function Overloads

D float32 glmStandardErrors(D int32[[1]] dependent, D int32[[2]] variables, D float32[[1]] coefficients, int64 family)

D float64 glmStandardErrors(D int64[[1]] dependent, D int64[[2]] variables, D float64[[1]] coefficients, int64 family)

D float32 glmStandardErrors(D float32[[1]] dependent, D float32[[2]] variables, D float32[[1]] coefficients, int64 family)

D float64 glmStandardErrors(D float64[[1]] dependent, D float64[[2]] variables, D float64[[1]] coefficients, int64 family)

GLMResult

GLM result type.

GLMResult<domain D, type T>

int64

family

family parameter used in the GLM call

D T

coefficients

fitted coefficients

D T

means

means calculated from the fitted coefficients

D T

linearPredictors

linear predictors calculated from the fitted coefficients