Learn R Programming

fastLaplace (version 0.0.2)

pred.sglmm: Model Predictions

Description

pred.sglmm is a function for predictions from the results of fsglmm.

Usage

pred.sglmm(fit.sglmm, data, coords, ntrial = 1, offset = NA)

Arguments

fit.sglmm

a list from fsglmm

data

a data frame to be predicted by the model.

coords

coordinates for prediction

ntrial

a numeric vector of the total number of trials ( binomial )

offset

a numeric vector indicating a known component to be included in the linear predictor for predictions.

Value

a vector of predicted mean parameters. (e.g. probabilities for binomial case)

Examples

Run this code
# NOT RUN {
## the result from fsglmm, data to be predicted, and the coordinates for prediction is required.

# }
# NOT RUN {
result <- fsglmm(Y~-1+X1+X2, kappa=2.5, inits = startinit, data = data,coords = coords,
family = "binomial", ntrial = 1, offset = NA,method.optim = "CG",method.integrate = "NR",rank = 50)
pred.sglmm(fit.sglmm=result,data=X.pred,)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab