[Vegan-commits] r2494 - pkg/vegan/tests/Examples
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Apr 21 10:16:02 CEST 2013
Author: jarioksa
Date: 2013-04-21 10:16:02 +0200 (Sun, 21 Apr 2013)
New Revision: 2494
Modified:
pkg/vegan/tests/Examples/vegan-Ex.Rout.save
Log:
update tests/Examples for ordisurf changes
Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save
===================================================================
--- pkg/vegan/tests/Examples/vegan-Ex.Rout.save 2013-04-21 02:05:40 UTC (rev 2493)
+++ pkg/vegan/tests/Examples/vegan-Ex.Rout.save 2013-04-21 08:16:02 UTC (rev 2494)
@@ -23,7 +23,7 @@
> options(warn = 1)
> library('vegan')
Loading required package: permute
-This is vegan 2.1-28
+This is vegan 2.1-29
>
> assign(".oldSearch", search(), pos = 'CheckExEnv')
> cleanEx()
@@ -161,10 +161,10 @@
Formula:
y ~ poly(x1, 1) + poly(x2, 1)
-<environment: 0x1024f0310>
+<environment: 0x10242dc98>
Total model degrees of freedom 3
-GCV score: 0.04278782
+REML score: -3.185099
>
>
>
@@ -4959,43 +4959,78 @@
Link function: identity
Formula:
-y ~ s(x1, x2, k = knots)
-<environment: 0x109d4df10>
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x10b539600>
Estimated degrees of freedom:
-6.45 total = 7.45
+5.63 total = 6.63
-GCV score: 144.0039
+REML score: 92.96761
>
-> ## as above but with extra penalties on smooth terms:
-> with(varechem, ordisurf(vare.mds, Baresoil, bubble = 5, col = "blue",
-+ add = TRUE, select = TRUE))
+> ## as above but without the extra penalties on smooth terms,
+> ## and using GCV smoothness selection (old behaviour of `ordisurf()`):
+> with(varechem, ordisurf(vare.mds, Baresoil,col = "blue", add = TRUE,
++ select = FALSE, method = "GCV.Cp"))
Family: gaussian
Link function: identity
Formula:
-y ~ s(x1, x2, k = knots)
-<environment: 0x10a978008>
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x108c2ba38>
Estimated degrees of freedom:
-6.12 total = 7.12
+6.45 total = 7.45
-GCV score: 139.9445
+GCV score: 144.0039
>
> ## Cover of Cladina arbuscula
> fit <- with(varespec, ordisurf(vare.mds, Cla.arb, family=quasipoisson))
> ## Get fitted values
> calibrate(fit)
- 1 2 3 4 5 6 7
-22.0596535 6.0185659 3.6298559 4.1000950 8.9833600 5.9067472 8.6617389
- 8 9 10 11 12 13 14
-11.0812152 0.6432691 35.2567124 10.4452454 7.2748478 5.5780162 24.6561685
- 15 16 17 18 19 20 21
-18.8879906 29.7642964 5.6095920 9.5945524 3.2753633 2.6966143 10.7869351
- 22 23 24
- 2.9902832 9.8082237 7.3406581
+ 1 2 3 4 5 6 7 8
+21.253963 5.675210 3.679486 3.898355 9.643787 7.698255 7.729282 9.758092
+ 9 10 11 12 13 14 15 16
+ 2.743202 29.700505 11.971987 8.310916 5.390556 24.906203 11.006871 25.330571
+ 17 18 19 20 21 22 23 24
+ 6.520735 9.410672 4.519645 4.090900 11.558075 4.314814 11.693769 14.244150
>
+> ## Variable selection via additional shrinkage penalties
+> ## This allows non-significant smooths to be selected out
+> ## of the model not just to a linear surface. There are 2
+> ## options available:
+> ## - option 1: `select = TRUE` --- the *default*
+> with(varechem,
++ ordisurf(vare.mds, Baresoil, method = "REML", select = TRUE))
+
+Family: gaussian
+Link function: identity
+
+Formula:
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x10af55c40>
+
+Estimated degrees of freedom:
+5.63 total = 6.63
+
+REML score: 92.96761
+> ## - option 2: use a basis with shrinkage
+> with(varechem,
++ ordisurf(vare.mds, Baresoil, method = "REML", bs = "ts"))
+
+Family: gaussian
+Link function: identity
+
+Formula:
+y ~ s(x1, x2, k = 10, bs = "ts", fx = FALSE)
+<environment: 0x1097c4cd0>
+
+Estimated degrees of freedom:
+4.43 total = 5.43
+
+REML score: 96.2345
+> ## or bs = "cs" with `isotropic = FALSE`
+>
> ## Plot method
> plot(fit, what = "contour")
>
@@ -5005,8 +5040,77 @@
> plot.gam(fit, cex = 2, pch = 1, col = "blue")
> ## 'col' effects all objects drawn...
>
+> ### controlling the basis functions used
+> ## Use Duchon splines
+> with(varechem, ordisurf(vare.mds, Baresoil, bs = "ds"))
+
+Family: gaussian
+Link function: identity
+
+Formula:
+y ~ s(x1, x2, k = 10, bs = "ds", fx = FALSE)
+<environment: 0x10b7a61b8>
+
+Estimated degrees of freedom:
+5.63 total = 6.63
+
+REML score: 93.17149
>
+> ## A fixed degrees of freedom smooth, must use 'select = FALSE'
+> with(varechem, ordisurf(vare.mds, Baresoil, knots = 4,
++ fx = TRUE, select = FALSE))
+
+Family: gaussian
+Link function: identity
+
+Formula:
+y ~ s(x1, x2, k = 4, bs = "tp", fx = TRUE)
+<environment: 0x10aa42df0>
+
+Estimated degrees of freedom:
+3 total = 4
+
+REML score: 81.86011
>
+> ## An anisotropic smoother with cubic regression spline bases
+> with(varechem, ordisurf(vare.mds, Baresoil, isotropic = FALSE,
++ bs = "cr", knots = 4))
+
+Family: gaussian
+Link function: identity
+
+Formula:
+y ~ te(x1, x2, k = c(4, 4), bs = c("cr", "cr"), fx = c(FALSE,
+ FALSE))
+<environment: 0x10b831308>
+
+Estimated degrees of freedom:
+2.99 total = 3.99
+
+REML score: 90.861
+>
+> ## An anisotropic smoother with cubic regression spline with
+> ## shrinkage bases & different degrees of freedom in each dimension
+> with(varechem, ordisurf(vare.mds, Baresoil, isotropic = FALSE,
++ bs = "cs", knots = c(3,4), fx = TRUE,
++ select = FALSE))
+
+Family: gaussian
+Link function: identity
+
+Formula:
+y ~ te(x1, x2, k = c(3, 4), bs = c("cs", "cs"), fx = c(TRUE,
+ TRUE))
+<environment: 0x1096b7828>
+
+Estimated degrees of freedom:
+11 total = 12
+
+REML score: 39.58245
+>
+>
+>
+>
> cleanEx()
detaching ‘package:mgcv’
@@ -5143,39 +5247,39 @@
Link function: identity
Formula:
-y ~ s(x1, x2, k = knots)
-<environment: 0x109344e40>
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x10b9719b8>
Estimated degrees of freedom:
-8.93 total = 9.93
+8.71 total = 9.71
-GCV score: 0.001054656
+REML score: -120.7705
> ordisurf(mite.xy, scores(pcnm1, choi=2), bubble = 4, main = "PCNM 2")
Family: gaussian
Link function: identity
Formula:
-y ~ s(x1, x2, k = knots)
-<environment: 0x10753d428>
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x10a84cc60>
Estimated degrees of freedom:
-7.75 total = 8.75
+7.18 total = 8.18
-GCV score: 0.002284958
+REML score: -103.4662
> ordisurf(mite.xy, scores(pcnm1, choi=3), bubble = 4, main = "PCNM 3")
Family: gaussian
Link function: identity
Formula:
-y ~ s(x1, x2, k = knots)
-<environment: 0x10b451988>
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x10b84f910>
Estimated degrees of freedom:
-8.9 total = 9.9
+8.32 total = 9.32
-GCV score: 0.002508871
+REML score: -94.19053
> par(op)
> ## Plot first PCNMs against each other
> ordisplom(pcnm1, choices=1:4)
@@ -7725,13 +7829,13 @@
Link function: identity
Formula:
-y ~ s(x1, x2, k = knots)
-<environment: 0x107bdc958>
+y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE)
+<environment: 0x10b4b0158>
Estimated degrees of freedom:
-2 total = 3
+1.28 total = 2.28
-GCV score: 0.07246275
+REML score: 3.006229
> ### Example 3: analysis of dissimilarites a.k.a. non-parametric
> ### permutational anova
> adonis(dune ~ ., dune.env)
@@ -8278,7 +8382,7 @@
> ### * <FOOTER>
> ###
> cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed: 81.366 1.596 84.769 0 0
+Time elapsed: 87.513 1.918 100.236 0 0
> grDevices::dev.off()
null device
1
More information about the Vegan-commits
mailing list