[adegenet-forum] spca and spatial weights matrix of proximity
Benoit Barrès
benoit.barres at helsinki.fi
Fri Jan 18 12:45:35 CET 2013
Thanks for your swift answer. I have checked the help file of the spca
function as well as the vignette you provide on the adegenet website, and I
didn't find any information on the additional constraints on the weights
matrix.
I just want to be sure to use the function properly. Here is an example of
the kind of matrix I'm using:
xy<-matrix(runif(10, min=300, max=600),5) #random longitude latitude
coordinates of 5 populations
xy
geodist<-(dist(xy,method="euclidean",diag=TRUE, upper=TRUE)) #computation of
the euclidean distance matrix between the populations
geodist
proxim<-prop.table(as.matrix(1/ geodist),1) #conversion of the distance
matrix to a "proximity" matrix (I am using here the inverse of the
geographical distance, just because it's simple)
proxim
rowSums(proxim)
Does this seems right to you? I'm curious about the row-sums=1 constraint.
Before you warn me on this, I used weights matrices that didn't satisfy this
constraint, but I received no error message and the spca function seemed to
work normally. What would be the effect on spca of using matrices that don't
fulfill this criteria?
My best,
Benoit
-----Original Message-----
From: Jombart, Thibaut [mailto:t.jombart at imperial.ac.uk]
Sent: Thursday, January 17, 2013 1:39 PM
To: Benoit Barrès; adegenet-forum at r-forge.wu-wien.ac.at
Subject: RE: [adegenet-forum] spca and spatial weights matrix of proximity
Hello,
yes. Additional constraint on the matrix is:
- values >= 0
- diagonal = 0
- row-sums = 1 (use prop.table)
Cheers
Thibaut
________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org
[adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Benoit
Barrès [benoit.barres at helsinki.fi]
Sent: 17 January 2013 09:36
To: adegenet-forum at r-forge.wu-wien.ac.at
Subject: [adegenet-forum] spca and spatial weights matrix of proximity
Dear Thibaut,
I want to use sPCA with a spatial weights matrix and I will need a
confirmation on the term spatial proximity. Am I right to think that the
more the entities are close to each other, the more the proximity value will
be high? Maybe it seems obvious, but I just want to be sure of that.
My Best,
Benoit
--
Benoit Barrès, Ph.D
Species Interactions in Metapopulations
Metapopulation Research Group
Department of Biosciences
PO Box 65 (Viikinkaari 1)
00014 University of Helsinki
FINLAND
More information about the adegenet-forum
mailing list