Mantel test error on environmental variables dataset
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyon! I am trying to run a Mantel test to check correlations and relationships between two variabels in different locations. I successfully create the distances matrices and have results for the test, but when trying to retrieve graphical output I have the following errors:
% Create figure(s)
% Do a non-dimensional scaling to color-code points according to similarity
% Stress < 0.2 indicates a reasonable scaling into one dimension
[Y0,STRESS0] = mdscale(GeoDistance2,1);
[Y1,STRESS1] = mdscale(CH4Distance2,1);
[Y2,STRESS2] = mdscale(H20Distance2,1); figure;scatter(Lats,Lons,mean(CH4ms,2),Y0);title('Color coding based on geographic proximity')
figure;scatter(Lats,Lons,mean(CH4ms,2),Y1);title('Color coding based on methane emission similarity')
figure;scatter(Lats,Lons,mean(CH4ms,2),Y2);title('Color coding based on water table similarity')
Elapsed time is 15.150658 seconds.
Error using mdscale>stress
Crit Points in the configuration have co-located.
Try a different starting point, or use a different criterion.
Error in mdscale>MDS (line 495) [stress,grad] = feval(stressFun, Y, disparities, weights);
Error in mdscale (line 394) [Y,stress,~,disparities] = MDS(Y0,dissimilarities,weights,stressFun,metric,weighted,options);
Error in AnalysisWithTrends (line 43) [Y0,STRESS0] = mdscale(GeoDistance2,1);
Do you have any tips for me? I have tried to add a small perturbation to the coordinate of the location (since some of them are repeated in the dataset, with different variables), but didn't resolve the issue.
Thanks everyone!
1 Kommentar
the cyclist
am 4 Jan. 2024
Can you upload the data, or at least a small sample that exhibits the same error? You can use the paper clip icon in the INSERT section of the toolbar.
Antworten (1)
Vinayak
am 8 Jan. 2024
Hi Emilia,
The error you've encountered with “mdscale” is likely due to co-located points in your data, which can arise from identical or nearly identical rows in your distance matrices.
Since you've already attempted adding a small perturbation without success, consider further randomizing these values slightly to achieve better results. Additionally, you might want to explore scaling in 2D or 3D, as 1D can be too restrictive for certain datasets.
Another avenue is to customize the configuration of the “mdscale” function by specifying a different starting point, stress criterion, etc. If the issue persists, your data may not be well-suited for multidimensional scaling, and alternative analysis approaches such as PCA or t-SNE could be more appropriate.
If possible, please share a sample of your data that exhibits the issue. This will help in providing more targeted assistance.
For more information on different dimensionality reduction techniques, you can refer to the following MathWorks documentation:
I hope this helps you with your project. Feel free to reach out for further clarifications.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!