Mann Kendall returns NaN
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
SuzieChan
le 12 Avr 2020
Réponse apportée : Ameer Hamza
le 12 Avr 2020
Hi,
I have a column of data. Some of this data has NaN values.
When I exeucte the test using the code
[H1,p_value1] = Mann_Kendall(data, 0.05);
The output returns NaN for the p-value.
This is nonsense.
How can I only apply the test to the numerical data, not the data + NaN values?
This will return an accurate result.
Maybe something like 'omitnan' will work?
Or maybe it is not written into the test code?
Any ideas?
Thanks.
0 commentaires
Réponse acceptée
Ameer Hamza
le 12 Avr 2020
Delete the nan values
data(isnan(data)) = [];
[H1,p_value1] = Mann_Kendall(data, 0.05);
or set them to zeros
data(isnan(data)) = 0;
[H1,p_value1] = Mann_Kendall(data, 0.05);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!