Description Usage Arguments Value Author(s) References See Also Examples
Performs generalized projection pursuit regression for binary and Poisson response variables. Wraps ppr from package stats in an iterative re-weighting algorithm. Included in package gsg to support inference of the form of natural selection, and for inference of selection gradients from projection pursuit regression-based inference of fitness functions.
1 2 |
y |
response variable, e.g., absolute fitness |
xterms |
names of predictor variables in data |
data |
a data frame containing columns with names matching xterms |
nterms |
number of terms to include in the final model |
tol |
maximum sum of relative changes in linear predictors between iterations |
gcvpen |
penalty used for each degree of freedom in GCV selection for spline ridge functions |
maxit |
maximum number if iterations of the iterative re-weighting procedure |
family |
distribution of the response variable, currently 'binomial' and 'Poisson' are supported |
max.terms |
the maximum number of terms to choose from when building the model |
... |
other parameters passed to ppr |
A gppr object, which contains a ppr object, plus information information pertaining to the iterative re-weighting procedure. Most of these repeat arguments passed to gppr(), also included are:
iterations |
the number of iterations of the iterative re-weighting procedure that were performed |
f |
the formula passed to ppr, constructed from xterms |
Michael Morrissey michael.morrissey@st-andrews.ac.uk
M.B. Morrissey. in prep.
predict.gppr, ppr,gppr.gradients
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # 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)
# direction of axes, and their loadings
fit.func$alpha
fit.func$beta
## not run - plot ridge functions (linear predictor scale)
# par(mfrow=c(1,2))
# plot(fit.func)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.