Hi,


I would like to do this:



```
fit <- test( measured_values, fitted_values )

```

Where:


* the return value from the `test` function is: **0 < fit < 1**.
* **measured\_values** are the observed data.
* **fitted\_values** are the data for the curve produced by GAM for the **measured\_values**.


What test can I use to compare the data sets that will result in a number between 0 and 1, where 0 indicates the measured values and the fitted values are not a good fit and 1 indicates the fitted values fit perfectly to the measured values?


For example, consider the data plotted here: <https://i.stack.imgur.com/wcrey.jpg>


The fit, produced by GAM, is fairly close to ideal. However, the standard correlations (shown in the bottom left) do not accurately indicate the goodness of fit.


Thank you.



Goodness-of-fit test for Generalized Additive Model
I meant only what is usually meant and you're being completely cryptic.


A wikipedia article titled "generalized additive model" says you've got
$$
g(\operatorname{E}(Y))=\beta\_0 + f\_1(x\_1) + f\_2(x\_2)+ \cdots + f\_m(x\_m)
$$
and then says "The functions $f\_i(x\_i)$ may be fit using parametric or non-parametric means, thus providing the potential for better fits to data than other methods. The method hence is very general". In other words, there's a lot you haven't said!! And then "a typical GAM might use a scatterplot smoothing function such as a locally weighted mean for $f\_1(x\_1)$, and then use a factor model for $f\_2(x\_2)$". So again, you're not telling us how you got this fit? E.g. are you using least squares? Or maximum likelihood? Are you picking the function $f\_1$ from some parametrized or otherwise well-behave class of functions? If so, WHICH ONE? And what function are you using for $g$? You're making me guess what you mean. Your graph looked as if your value of $m$ was probably 1. Which makes me begin to wonder why you're calling it "additive". I'm guessing the graph you linked to was not brought down from Heaven by an archangel. Can you say how you got it?


