[f,x]=ecdf(y) definationf of x
6 次查看(过去 30 天)
显示 更早的评论
Hallo everyone,
Now i just do the statsic data analysis by ecdf function.
so i have a matrix, and i change this matrix in to a colum.
[f,x]=ecdf(y)
y represent this colum. then i get a colum of f and a colum of x, and plot (x, f),
i would like to know what it means for x, f is the cumulative function, also the probility.
how they caculate f and x based on the y
Thank so much
Jialin
0 个评论
采纳的回答
Torsten
2022-6-22
There are six literature reference at the bottom of the page.
Usually, the minimum and maximum value of the y-data is determined. The interval [ymin,ymax] is divided in a certain number of subintervals (bins). According to their value, the y-data are put into the bin where they belong. Then the number of y-data in each bin is divided by the total number of y-data. Let us call these values bi (i=1,...,n = number of bins) (note that they sum to 1). Then it is set
B1 = b1
B2 = b1+b2
...
Bn-1 = b1 + b2 + ... + bn-1
Bn = 1
and the B1,B2,...,Bn are plotted as ecdf.
5 个评论
Torsten
2022-6-22
编辑:Torsten
2022-6-22
this x axis is minpoint of bins.right?
Yes, your y-data seem to range between 0 (ymin) and 0.8 (ymax).
i don't understand why there is negative value, actually all the value from Y is positive.
My guess is that you chose a normal distribution to approximate your empirical pdf - and the normal distribution has mass on the complete real axis (thus also for y being negative). That's why approximating your empirical pdf by a normal distribution is most probably a bad choice. Try a LogNormal distribution or something advised in the literature for your application.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!