The Part: Kolmogorov and Smirnov
The Kolmogorov-Smirnov test is a true expression of statistics. First, Kolmogorov proposed a particular method for testing the difference between an observed distribution and a hypothesized distribution. This distribution was an infinite sum of weighted Chi-square distributions. In other words, Kolmogorov provided the exact distribution, even though it was difficult to use.
Second, Smirnov provided a simplification to the mathematically exact distribution of Kolmogorov. This simplification helped make the Kolmogorov-Smirnov test usable. In other words, the mathematics got us to the exact, yet not useful, result and statistics got us something useful (yet only approximate).
In this assignment, the first problem deals with determining the value of \(D\) from the Kolmogorov-Smirnov test by hand for some distributions. The second problem has you checking your work using R
.
Problem 1: The Probability Function
Calculate the value of \(D\) for the empirical (observed) distribution of the net profit and each of the two distributions below.
To do this, you will need to first calculate the empirical (observed) cumulative distribution of the data. The data you use will be the daily net profit earned by the Lamplighter Restaurant. The variable is a part of the lamplighterSales.csv
dataset located at
https://courses.kvasaheim.com/math322/assignments/lamplighterSales.csv
Then, you will need to use the theoretical CDF for these distributions to calculate the maximum difference between the two.
The two distributions you will use are
- Normal\((\mu=2000;\ \sigma=1000)\)
- Poisson\((\lambda=2000)\)
Problem 2: The R
Function
Check your work using the ks.test
function in R
. Explain any differences.