[Vegan-commits] r1577 - in pkg/vegan: R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Apr 7 18:19:59 CEST 2011


Author: jarioksa
Date: 2011-04-07 18:19:59 +0200 (Thu, 07 Apr 2011)
New Revision: 1577

Modified:
   pkg/vegan/R/monoMDS.R
   pkg/vegan/src/monoMDS.f
Log:
monoMDS Fortran returns stress for each group in hybrid and local scaling

Modified: pkg/vegan/R/monoMDS.R
===================================================================
--- pkg/vegan/R/monoMDS.R	2011-04-07 15:59:05 UTC (rev 1576)
+++ pkg/vegan/R/monoMDS.R	2011-04-07 16:19:59 UTC (rev 1577)
@@ -101,8 +101,9 @@
                  sratmx = as.double(sratmax), strmin = as.double(smin),
                  sfgrmn = as.double(sfgrmin), dist = double(ndis),
                  dhat = double(ndis), points = double(k*nobj),
-                 stress = double(1), iters = integer(1),
-                 icause = integer(1), PACKAGE = "vegan")
+                 stress = double(1), grstress = double(ngrp),
+                 iters = integer(1), icause = integer(1),
+                 PACKAGE = "vegan")
     sol$call <- match.call()
     sol$model <- model
     sol$points <- matrix(sol$points, nobj, k)

Modified: pkg/vegan/src/monoMDS.f
===================================================================
--- pkg/vegan/src/monoMDS.f	2011-04-07 15:59:05 UTC (rev 1576)
+++ pkg/vegan/src/monoMDS.f	2011-04-07 16:19:59 UTC (rev 1577)
@@ -2,10 +2,15 @@
      .  DISS, IIDX, JIDX, XINIT, ISTART,
      .  ISFORM, ITIES, IREGN, ISCAL, MAXITS, SRATMX,
      .  STRMIN, SFGRMN, 
-     .  DIST, DHAT, X, STRESS, ITERS, ICAUSE)
+     .  DIST, DHAT, X, STRESS, STRS, ITERS, ICAUSE)
 C
 C Subroutine for multidimensional scaling.
 C
+C 1.00 March 28, 2011
+C 1.01 April 6, 2011  - added argument STRS(NGRP) to return the stress
+C                       for each of the NGRP groups of dissimilarities
+C                       i.e., from each separate regression.
+C
 C Written by Dr. Peter R. Minchin
 C            Department of Biological Sciences
 C            Southern Illinois University Edwardsville
@@ -101,7 +106,7 @@
 C
 C DIST(NDIS) = distances among objects in the final ordination
 C
-C DHAT(NDIS) = fitted distances in final regression of distance
+C DHAT(NDIS) = fitted distances in final regression(s) of distance
 C              on dissimilarity
 C
 C X(NOBJ,NDIM) = final ordination coordinates of NOBJ objects in NDIM
@@ -109,6 +114,8 @@
 C
 C STRESS = final value of stress
 C
+C STRS(NGRP) = vector of stress values from each separate regression
+C
 C ITERS = number of iterations performed
 C
 C ICAUSE = reason for termination of iterations: 1 = max iterations
@@ -125,10 +132,10 @@
 C---OUTPUT ARGUMENTS
       INTEGER, INTENT(OUT) :: ITERS, ICAUSE
       DOUBLE PRECISION, INTENT(OUT) :: X(NOBJ,NDIM), DIST(NDIS), 
-     .  DHAT(NDIS), STRESS
+     .  DHAT(NDIS), STRESS, STRS(NGRP)
 C---ALLOCATABLE TEMPORARY ARRAYS
       INTEGER, ALLOCATABLE :: IWORK(:)
-      DOUBLE PRECISION, ALLOCATABLE :: GRAD(:,:), GRLAST(:,:), STRS(:)
+      DOUBLE PRECISION, ALLOCATABLE :: GRAD(:,:), GRLAST(:,:)
 C
       DOUBLE PRECISION :: STRLST, SQRTN, SRATF1, SRATF2, FNGRP,
      .  STRINC, COSAV, ACOSAV, SRATAV, STEP, FNDIM, SFGR, SRATIO,
@@ -137,8 +144,7 @@
 C
 C ALLOCATE THE TEMPORARY ARRAYS NEEDED
 C
-      ALLOCATE (IWORK(NDIS), GRAD(NOBJ,NDIM), GRLAST(NOBJ,NDIM), 
-     .  STRS(NGRP))
+      ALLOCATE (IWORK(NDIS), GRAD(NOBJ,NDIM), GRLAST(NOBJ,NDIM))
 C
 C INITIALIZE SOME PARAMETERS
 C
@@ -346,7 +352,7 @@
 C
 C DEALLOCATE THE TEMPORARY ARRAYS AND RETURN
 C
-      DEALLOCATE (IWORK, GRAD, GRLAST, STRS)
+      DEALLOCATE (IWORK, GRAD, GRLAST)
       RETURN
       END SUBROUTINE monoMDS
 



More information about the Vegan-commits mailing list