Description Usage Arguments Details Value Examples
This is an internal function of package ggam
.
1 2 3 4 |
Y |
Response variable. |
B |
The bernstein basis matrix. |
Q2 |
The |
P |
The penalty matrix. |
UB |
The univariate basis function matrix constructed. |
lambda |
The smoothing penalty parameter. |
family |
The family object, specifying the distribution and link to use. |
offset |
Can be used to supply a model offset for use in fitting. Note that this offset will always be completely ignored when predicting. |
theta |
The given theta values in negative binomial family. |
fx |
indicates whether the term is a fixed d.f. regression |
control |
A list of fit control parameters to replace defaults returned by |
start |
Initial values for model coefficients |
etastart |
Initial values for linear predictor. |
mustart |
Initial values for the expected response. |
X |
The parametric model matrix. set to ' |
ind_c |
The vector of index to indicate the parametric part. |
fixedSteps |
How many steps to take: useful when only using this routine to get rough starting values for other methods. |
... |
other arguments. |
See section 4 'Implementation' in Shan et al. (2018).
A list of fit information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(BPST)
data("eg_poi")
eg1_V1 <- eg_poi[['V1']]
eg1_T1 <- eg_poi[['T1']]
sam <- eg_poi[['sam_poi']]
d <- 2
r <- 1
B0 <- basis(eg1_V1,eg1_T1, d, r, sam[,c('loc1','loc2')])
B <- B0$Bi
ind <- B0$Ind.inside
Q2 <- B0$Q2
K <- B0$K
Z <- sam[ind,c(5:12)]
Y <- sam[ind,'y']
lambda_start <- 0.01
lambda_end <- 32
nlambda <- 10
lambda <- exp(seq(log(lambda_start),log(lambda_end),length.out=nlambda))
X <- sam[,1:15]
P <- t(Q2)%*%K%*%Q2
gplsfitGCV(Y,as.matrix(B),Q2,P,UB=NULL,lambda=lambda,family=poisson(),offset=0,fx=FALSE,
control = plbpsm.control(),X=as.matrix(X))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.