glms: Generalized Linear Model Fitters

Description Usage Arguments Details Value Communication References See Also Examples

Description

Linear regression (Gaussian GLM), logistic regression, and poisson regression model fitters.

Usage

1
2
3
4
5
reg.fit(x, y, maxiter = 100)

logistic.fit(x, y, maxiter = 100)

poisson.fit(x, y, maxiter = 100)

Arguments

x, y

The input data x and response y. Each must be a shaq, and each must be distributed in an identical fashion. See the details section for more information.

maxiter

The maximum number of iterations.

Details

Each function is implemented with gradient descent using the conjugate gradients method ("CG") of the optim() function.

Both of x and y must be distributed in an identical fashion. This means that the number of rows owned by each MPI rank should match, and the data rows x and response rows y should be aligned. Additionally, each MPI rank should own at least one row. Ideally they should be load balanced, so that each MPI rank owns roughly the same amount of data.

Value

The return is the output of an optim() call.

Communication

The communication consists of an allreduce of 1 double (the local cost/objective function value) at each iteration of the optimization.

References

McCullagh, P. and Nelder, J.A., 1989. Generalized Linear Models, no. 37 in Monograph on Statistics and Applied Probability.

Duda, R.O., Hart, P.E. and Stork, D.G., 1973. Pattern classification (pp. 526-528). Wiley, New York.

See Also

lm_coefs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(kazaam)
comm.set.seed(1234, diff=TRUE)

x = ranshaq(rnorm, 10, 3)
y = ranshaq(function(i) sample(0:1, size=i, replace=TRUE), 10)

fit = logistic.fit(x, y)
comm.print(fit)

finalize()

## End(Not run)

kazaam documentation built on May 2, 2019, 8:55 a.m.