# Why does (bivariate) ksdensity() return decreasing cdf values?

2 visualizzazioni (ultimi 30 giorni)
Andreas Haselsteiner il 31 Mar 2017
Modificato: Oskar Adolfson il 28 Nov 2017
Hi guys,
I encountered decreasing values of the estimated cumulative distribution function when using ksdensity. I think this should not be possible, since F(x1,x2) is defined to be non-decreasing (see e.g. https://en.wikipedia.org/wiki/Cumulative_distribution_function#Multivariate_case). Why can ksdensity return decreasing values?
This is a minimum code example:
rng default % for reproducibility
x = [0+.5*rand(20,1) 5+2.5*rand(20,1);
.75+.25*rand(10,1) 8.75+1.25*rand(10,1)];
[F,xi] = ksdensity(x,'function','cdf');
figure
ksdensity(x,xi,'function','cdf');
xlabel('x1');
ylabel('x2');
zlabel('F(x1,x2)');
title({'Problem: Decreasing cumulative distribution function', ...
'e.g. F(x1=0,x2=11) > F(x1=0,x2=13)'});
Which plots this:
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Oskar Adolfson il 28 Nov 2017
Modificato: Oskar Adolfson il 28 Nov 2017
This is a known bug which was fixed in the R2017b MATLAB version. Anyone using R2017b or newer versions shouldn't encounter this problem anymore.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Hypothesis Tests in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by