# Comparison between two stairs graphs

16 views (last 30 days)
mercury on 20 Oct 2013
Answered: Jonathan LeSage on 22 Oct 2013
Hi all, In a statistics project I have to calculate the maximum of the norm of difference between two graphs (kolmogorov-smirnov distance). The graphs are from empirical data. I tried to create a vector of differences between the two graphs (which are stair graphs) but we don't have the same number of points. Worst, we don't know the x-coordinates to access all the f1(x) and f2(x) to compare them. I searched for 2 days, please any help is welcome. this is a part of the code and the graphs. You can see that the graphs represent the relative cumulate frequencies obtained from the same data (a vector of numbers from (0 to 20). One vector is contructed from a sample of the data and one of the entire data. Then I have just compare the plots generated by cdfplot function:
freq_cum_theorie = cdfplot(vect_moy_theorie); hold on freq_cum_echant_theorie = cdfplot(moy_echant_theorie); hold on
Thank you a lot.