I am currently reading an engineering book that discusses measurements, and there is a section about the chi-squared test. As I am not an expert in statistics, I am struggling to understand why the author presents two different expressions of $\chi^2$ in different parts of the book. I would like to know if it is possible to convert one expression to the other or if they represent different concepts.
The first expression is: $$\chi^2=\sum_i \frac {(O_i-E_i)^2} {E_i} $$ where:
- $O_i=$=the number of observations of type i
- $E_i=$the expected count of type of type i
the second expression is
$$\chi^2= \frac 1 {\bar x_e} \sum_j^N (x_j-\bar x_e)^2$$
where the summation is taken over each individual data point $x_i$, and $\bar x_e$ is the average value of the sample, $\bar x_e=\frac {\sum_j^N x_j} N$
Maybe It might be relevant to mention that the datapoint distribution is a Poisson.