[Vegan-commits] r1361 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Nov 10 15:03:07 CET 2010
Author: jarioksa
Date: 2010-11-10 15:03:06 +0100 (Wed, 10 Nov 2010)
New Revision: 1361
Modified:
pkg/vegan/R/SSlomolino.R
Log:
Lomolino tweaks
Modified: pkg/vegan/R/SSlomolino.R
===================================================================
--- pkg/vegan/R/SSlomolino.R 2010-11-10 10:18:55 UTC (rev 1360)
+++ pkg/vegan/R/SSlomolino.R 2010-11-10 14:03:06 UTC (rev 1361)
@@ -11,14 +11,11 @@
.S <- exp(.p[1] + log(max(xy[["x"]])) * (.p[2]))
.S <- max(.S, .Smax)
.xmid <- exp((log(.S/2) - .p[1])/.p[2])
- ## approximate slope using y = log(Smax/S - 1)
+ ## approximate slope for log(Asym/y - 1) ~ log(xmid/x) + 0
.y <- log(.S/xy[["y"]] - 1)
- .x <- xy[["x"]]
.z <- log(.xmid/xy[["x"]])
- .b <- coef(lm(.y ~ .z))
- ## Adjust Asym: half of y = Asym/2 at xmid
- ##.S <- .S * exp(-0.5 * (.b[1]))
- value <- c(.S, .xmid, exp(.b[2]))
+ .b <- coef(lm(.y ~ .z - 1))
+ value <- c(.S, .xmid, exp(.b))
names(value) <- mCall[c("Asym","xmid", "slope")]
value
},
More information about the Vegan-commits
mailing list