; Using the K-S test routine, kstwo_plot.pro 5/4/05-dd ; Comparing two uniform distributions: ; ; data1 = randomu(seed, 100) data2 = randomu(seed, 200) kstwo_plot, data1, data2, D, prob ; change one in "width" (factor) and/or offset: kstwo_plot, 1.1*data1, data2, D, prob kstwo_plot, 1.2*data1, data2, D, prob kstwo_plot, 1.2*data1-0.1, data2, D, prob kstwo_plot, 1.2*data1-0.2, data2, D, prob ; etc. ; Compare a uniform distibution (data2) to a Gaussian (data3): ; data3=data2 for id=0,n_elements(data3)-1 do data3(id)=g_rand(seed) kstwo_plot, data3, data2, D, prob ; not very similar! ; Scale and offset the uniform distribution ; to approximate a Gaussian in RMS sense: kstwo_plot, data3, (data2-0.5)/0.29, D, prob ; not too bad... ; Using more data points the difference is clearer: data2 = randomu(seed, 2000) data3=data2 for id=0,n_elements(data3)-1 do data3(id)=g_rand(seed) kstwo_plot, data3, (data2-0.5)/0.29, D, prob