R: goodness-of-fit test using Kolmogorov-Smirnov [closed]
I have a problem when I run the Komogorov-Smirnov test.
I have to samples of daily prices distributions estimated with density(). Now I would like to compare these two distributions with each other.
Date price 01.01.2010 1.2 02.01.2010 1.5 etc.
Date price 01.01.2009 0.1 02.01.2009 0.05 etc.
For the probability density, I calculated
Now I wanted to run the KS-test:
ks <- ks.test(density.1$x, density.2$x)
and got the results that p=1, hence the two distributions are the same. However, it is already observable from eye that they differ quite heavily from each other.
Where is my mistake?
Thank you, Dani