statistics - Fitting the cumulative distribution function using MATLAB -
statistics - Fitting the cumulative distribution function using MATLAB -
how possible create next info more fitted when plot using cumulative_distribution_function?
here code, plotted using cdfplot
clear all; close all; y = [23 23 23 -7.59 23 22.82 22.40 13.54 -3.97 -4.00 8.72 23 23 10.56 12.19 23 9.47 5.01 23 23 23 23 22.85 23 13.61 -0.77 -14.15 23 12.91 23 20.88 -9.42 23 -1.37 1.83 14.35 -8.30 23 15.17 23 5.01 22.28 23 21.91 21.68 -4.76 -13.50 14.35 23] cdfplot(y)
there no definite reply question, broad , belongs statistics. before doing computation should reply questions:
is there specific distribution type info follow? is there theoretical justification select distribution type , discard others? do need parametric or non-parametric distribution? if no specific distribution type can selected set of distributions should investigate? how compare distributions, goodness-of-fit measures? what fitting method should use, e.g. max-likelihood, method of moments, bayesian, etc.? how treat uncertainties? how , want utilize results? etc.without answering these question meaningless talk fitting distribution data. give illustration how fit in matlab using maximum-likelihood method, illustration, discourage utilize without considering above points.
since have no additional background info in respect of nature of data, normal , kernel distributions fitted illustrate 1 parametric , 1 non-parametric distribution.
cdfplot(y) hold on xx = -20:40; %normal distribution pd_norm = fitdist(y', 'normal'); f_norm = normcdf(xx, pd_norm.mu, pd_norm.sigma); plot(xx, f_norm, 'r') %kernel distribution pd_kernel1 = fitdist(y', 'kernel', 'kernel', 'normal', 'width', 6); f_kernel1 = cdf(pd_kernel1, xx); plot(xx, f_kernel1, 'g') %kernel distribution pd_kernel2 = fitdist(y', 'kernel', 'kernel', 'normal', 'width', 2); f_kernel2 = cdf(pd_kernel2, xx); plot(xx, f_kernel2, 'black') legend('ecdf', 'normal', 'kernel1', 'kernel2', 'location', 'northwest')
statistics matlab
Comments
Post a Comment