Mann Kendall returns NaN

4 visualizaciones (últimos 30 días)
SuzieChan
SuzieChan el 12 de Abr. de 2020
Respondida: Ameer Hamza el 12 de Abr. de 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.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 12 de Abr. de 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);

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by