This is perhaps basic but I couldn't find a suitable reference.
I have a regression model with a rather complicated link function. So $\vec{x}$ is a vector of continuous predictors, and $z$ is a binary variable such that according to the model: $Pr(z=1) = f(\vec{x})$ for some (known) function $f$.
I observe data of the form $(\vec{x}^{(1)}, z^{(1)}), (\vec{x}^{(2)}, z^{(2)}), (\vec{x}^{(n)}, z^{(n)})$ and want to test the null hypothesis that the above model is the one generating the data - that is compute a statistic and reject the model if the statistic is too extreme. What would be a good goodness-of-fit test for this case? is there a 'standard' way to test for this?
One possibility is binning the data points by the value of $f(\vec{x})$, (say to $10$ bins: $([0,0.1], ..[0.9,1])$ and performing a chi-square test for expected vs. observed proportion of $z$'s in each bin. Another is to bin the multidimensional space of the $\vec{x}$'s (say if $\vec{x}$ is two-dimensional, we can divide $R^2$ to $100$ squares and compute a chi-square for observed vs. expected for each square). Yet another one is not binning at all but just computing $\sum_i (z^{(i)} - f(\vec{x}^{(i)}))^2/f(\vec{x}^{(i)})$ but this seems to cause numerical issues since sometimes $f(\vec{x}^{(i)})$ is very small. Are there other known approaches? which test would be the most appropriate?