I have a set of data, $y$ and $x$. I would like to test the following hypothesis: There is a peak in $y$; that is as $x$ increases, $y$ first increases and then decreases.
My first idea was fitting $x$ and $x^2$ in a SLR. That is, if I find that the coefficient before $x$ is significantly positive and the coefficient before $x^2$ is significantly negative, then I have support for the hypothesis. However, this only checks for one type of relationship (quadratic) and may not necessarily capture the existence of the peak.
Then I thought of finding $b$, such a region of (sorted values of) $x$, that $b$ is between $a$ and $c$, two other regions of $x$ that contain at least as many points as $b$, and that $\bar{y_b}>\bar{y_a}$ and $\bar{y_b}>\bar{y_c}$ significantly. If the hypothesis is true, we should expect many such regions $b$. Thus, if the number of $b$ is sufficiently large, there should be support for the hypothesis.
Do you think I am on the right track to find a suitable test for my hypothesis? Or am I inventing the wheel and there is an established method for this problem? I will greatly appreciate your input.
UPDATE. My dependent variable $y$ is count (non-negative integer).