MATLAB Answers

# How can I calculate the empircal CDF from an empirical PDF when dimensions are greater than 2?

22 views (last 30 days)
Greg on 28 Jul 2014
Commented: Greg on 23 Feb 2018
I would like to calculate the empirical cumulative distribution of a data set with more than 2 dimensions. The only examples I have been able to find are for bivariate data (using hist3 and cumsum). Below is an example 3 dimensional PDF. I would like a robust solution that can accommodate any number of dimensions, if possible. Any help would be very much appreciated. Thank you.
sPDF(1,1,1) = 1;
sPDF(2,1,1) = 2;
sPDF(1,2,1) = 3;
sPDF(2,2,1) = 4;
sPDF(1,1,2) = 5;
sPDF(2,1,2) = 6;
sPDF(1,2,2) = 7;
sPDF(2,2,2) = 8;
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Star Strider on 28 Jul 2014
See if the mvncdf function and its friends do what you want.
##### 10 CommentsShowHide 9 older comments
Greg on 23 Feb 2018
You could try interpolating the NaN values first. Something like the following: inpaint This one may also work: inpainting Or you could try fitting a neural network to the data and predict those NaN values.

Sign in to comment.

### Community Treasure Hunt

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

Start Hunting!