pspline_fitter {JOPS}R Documentation

P-spline fitting algorithm for the GLM.

Description

pspline_fitter appies the method of scoring to a variety of response distributions and link functions within for P-spline fitting within the GLM framework.

Usage

pspline_fitter(
  y,
  B,
  family = "gaussian",
  link = "identity",
  P,
  P_ridge = 0 * diag(ncol(B)),
  wts = 0 * y + 1,
  m_binomial = 0 * y + 1,
  r_gamma = 0 * y + 1
)

Arguments

y

the glm response vector of length m.

B

The effective P-spline regressors, e.g. B for B-splines, Q=X %*% B for PSR.

family

the response distribution, e.g. "gaussian", "binomial", "poisson", "Gamma" distribution; quotes are needed (default family = "gaussian".)

link

the link function, one of "identity", "log", "sqrt", "logit", "probit", "cloglog", "loglog", "reciprocal"; quotes are needed (default link = "identity").

P

P-spline ("half") penalty matrix for data augmentation, such that P'P = lambda D'D.

P_ridge

ridge ("half") penalty for data augmentation, usually sqrt(lambda_r)*I (default 0).

wts

the weight vector of length(y), separate from GLM weights.

m_binomial

a vector of binomial trials having length(y), when family = "binomial". Default is 1 vector.

r_gamma

a vector of gamma shape parameters, when family = "Gamma". Default is 1 vector.

Value

coef

the estimated P-spline coefficient regressor, using the effective regressors.

w

wts*w, GLM weight vector times input weights of length m.

f

the lsfit object using data augmentation to get P-spline coefficient estimates.

eta

the linear predictor from f.


[Package JOPS version 0.1.19 Index]