predict.gppr: Generalised projection pursuit regression

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/predict.gppr.R

Description

Obtains linear predictor- or data-scale predictions for a fitted gppr object

Usage

1
predict.gppr(object,newdata,type="link")

Arguments

object

a fitted gppr object

newdata

an optional data frame containing new predictor variable values. If 'newdata' is omitted, then the predictions are made for the original data from which the gppr model was fitted.

type

the type of prediction required. The default is the scale of the linear predictor, alternativels 'type="response"' gives expected values.

Value

A vector of predictions.

Author(s)

Michael Morrissey michael.morrissey@st-andrews.ac.uk

References

M.B. Morrissey. in prep.

See Also

gppr, ppr,gppr.gradients

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# simulated data (two traits, stabilizing selection on trait 1)
n<-250
z<-cbind(rnorm(n,0,1),rnorm(n,0,1))
W<-rpois(n,exp(2-0.6*z[,1]^2))
d<-as.data.frame(cbind(W,z))
names(d)<-c("W","z1","z2")

fit.func<-gppr(y="W",xterms=c("z1","z2"),data=d,family="poisson",
   nterms=2,max.terms=2)

# hist(predict(fit.func))

gsg documentation built on May 2, 2019, 9:37 a.m.