Hello all,
I have my set of data and I estimated the function using kernel, however the Bandwidth must be estimated for a correct density from the given data. I just put 0.2 for initial start so I will be able to play around with the bandwidth before looking into proper method but the kernel didn't work for width = 0.2,however for another set of data it did work. there is more proffesional method to pick the best bandwith for the given data and it is using mean integrated squared error, Is there any in-built function in Matlab, I didn't seem to find any, not sure if there is a method in one of the toolboxes not available to me. I would like to know why the width 0.2 is not working to my code??..
Thank you all,
sample1 = [6.52689332414481E76.52693837402845E76.5270203713004336E76.527122138667133E76.52717237415096E76.527173346449997E76.527211590239384E76.5272540473269284E76.527282568117965E76.527314005807114E7];x = sample1.';[xi,f]=ksdensity(x,'width',0.2);plot(f,xi); line(repmat(x,2,1),repmat([0;0.1*max(xi)],1,length(x)),'color','g' );
Best Answer