bcrossv.l: LOESS regression parameters selection through bootstrap...

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

Description

This function applies v-fold crossvalidation (CV) of LOESS regressions with varying α and degree for a single taxon.

Usage

1
2
bcrossv.l(x, y, interval = c(0.15, 1, 0.05), 
         trials = c(10, 0.25), plot = TRUE)

Arguments

x

A vector containing the environmental gradient value for each sample or location.

y

A vector containing the observed taxa abundances along the environmental gradient.

interval

α values to be evaluated. Three numbers in the following order: lower and upper limits of the α-values sequenceto be evaluated, and the increment of the sequence.

trials

Values for number of repetitions of the crossvalidation (100 by default), and proportion of observations to be left out each time the CV is repeated (0.25 by default). The observations left out each time are randomly selected with replacement.

plot

Logical indicating whether or not an observed vs. error is desired

Details

A sequence of α values is generated according to the range and increments declared in interval (from 0.15 to 1 in 0.05 increments). The sequence of α values is combined with degree 1 and 2, and the LOESS regression produced using each combination is cross-validated as explained in bcrossv.l1. See Cleveland and Devlin (1988) for details on loess regression.

Value

A matrix of 4 columns. All possible combinations of α values generated by the sequence interval and degree 1 and 2 are contained in the first and second columns. The third column contains the root of the predictive squared error (rse, (1/n*sum(est-obs)^2)^0.5). The fourth column contains the root mean squared error (rmse, 1/n*sum(abs(obs-est))). If plot=TRUE, a scatter plot of the rse and the rmse conditioned to the degree of the loess regression is produced.

This function involves very intensive computations. Therefore, the user must find a balance between values of interval and trials, and the computational capabilities. Large number of trials may require long computation times.

Author(s)

Alexander Correa-Metrio, Kenneth R. Cabrera.

References

Cleveland, W.S., and S.J. Devlin. 1988. Locally weighted regression: An approach to regression analysis by local fitting. Journal of the American Statistical Association 83: 596-610.

See Also

loess for details on loess regression. bcrossv.l1 for details on the bootstrap cross-validation.

Examples

1
2
3
4
5
data(modernq)
# Calculate percentages
perq<-percenta(modernq,first=2,last=39)[,2:55]
# Cross-validation for Pinus
bcrossv.l(modernq[,1],perq[,3],trials=c(10,0.1))

paleoMAS documentation built on May 2, 2019, 6:46 a.m.