Learn R Programming

VGAM (version 0.7-3)

cao.control: Control Function for RR-VGAMs (CAO)

Description

Algorithmic constants and parameters for a constrained additive ordination (CAO), by fitting a reduced-rank vector generalized additive model (RR-VGAM), are set using this function. This is the control function for cao.

Usage

cao.control(Rank=1, all.knots = FALSE,
            criterion="deviance",
            Cinit=NULL,
            Crow1positive=TRUE,
            epsilon = 1.0e-05,
            Etamat.colmax = 10,
            GradientFunction=FALSE,
            iKvector = 0.1,
            iShape = 0.1,
            Norrr = ~ 1,
            SmallNo = 5.0e-13,
            Use.Init.Poisson.QO=TRUE,
            Bestof = if(length(Cinit)) 1 else 10,
            maxitl = 40,
            method.init = 1,
            bf.epsilon = 1.0e-7,
            bf.maxit = 40,
            Maxit.optim = 250,
            optim.maxit = 20,
            SD.sitescores = 1.0,
            SD.Cinit = 0.02,
            trace = TRUE,
            df1.nl = 2.5, df2.nl = 2.5,
            spar1 = 0, spar2 = 0, ...)

Arguments

Value

  • A list with the components corresponding to its arguments, after some basic error checking.

Details

Allowing the smooths too much flexibility means the CAO optimization problem becomes more difficult to solve. This is because the number of local solutions increases as the nonlinearity of the smooths increases. In situations of high nonlinearity, many initial values should be used, so that Bestof should be assigned a larger value. In general, there should be a reasonable value of df1.nl somewhere between 0 and about 3 for most data sets.

References

Yee, T. W. (2006) Constrained additive ordination. Ecology, 87, 203--213.

Green, P. J. and Silverman, B. W. (1994) Nonparametric Regression and Generalized Linear Models: A Roughness Penalty Approach, London: Chapman & Hall.

See Also

cao.

Examples

Run this code
data(hspider)
hspider[,1:6] = scale(hspider[,1:6]) # Standardized environmental vars
set.seed(123)
ap1 = cao(cbind(Pardlugu, Pardmont, Pardnigr, Pardpull, Zoraspin) ~
         WaterCon + BareSand + FallTwig +
         CoveMoss + CoveHerb + ReflLux,
         family = poissonff, data = hspider,
         df1.nl = c(Zoraspin=2.3, 2.1),
         Bestof = 10, Crow1positive = FALSE)
sort(ap1@misc$deviance.Bestof) # A history of all the iterations

Coef(ap1)

par(mfrow=c(2,3)) # All or most of the curves are unimodal; some are
plot(ap1, lcol="blue") # quite symmetric. Hence a CQO model should be ok

par(mfrow=c(1,1), las=1)
index = 1:ncol(ap1@y)  # lvplot is jagged because only 28 sites
lvplot(ap1, lcol=index, pcol=index, y=TRUE)

trplot(ap1, label=TRUE, col=index)
abline(a=0, b=1, lty=2)

persp(ap1, label=TRUE, col=1:4)

Run the code above in your browser using DataLab