# With some shared parameters, and some not, what are my degrees of freedom?

I have a data matrix $$X$$ of size $$m \times (n+1)$$ where there are $$n$$ dependent variables and one independent variable $$t$$. I also have a collection of $$n$$ nonlinear functions $$f_1, \cdots, f_j, \cdots, f_n$$ predicting those first $$n$$ column variables with the $$n+1$$ column, representing time $$t$$. Each function has a collection of parameters $$\theta_{1, j}, \cdots, \theta_{{h_j}, j}$$ that are not shared across other functions, and a collection of shared parameters $$\gamma_1, \cdots, \gamma_p$$ across all aforementioned functions.

Thus a given regression equation would look like:

$$X_j = f_j \left(t; \theta_{1, j}, \cdots, \theta_{{h_j}, j}, \gamma_1, \cdots, \gamma_p \right)$$

I will be simultaneously parameterizing the models, but I am unsure how to calculate the degrees of freedom. It would seem that the parameters $$\theta_{1, j}, \cdots, \theta_{{h_j}, j}$$ would contribute $$n\left(m - \sum_{j=1}^n {h_j}\right)$$ degrees of freedom while the shared parameters $$\gamma_1, \cdots, \gamma_p$$ would contribute $$mn - p$$ degrees of freedom. But when I consider how to combine them it occurs to me that their sum may be double counting sample entries. One possibility is $$mn - \sum_{j=1}^n {h_j} - p$$ that uses the notion of sample size minus the number of parameters, but I am unsure if this is appropriate here.

How should I calculate the degrees of freedom for this parametrization?

• What do you plan to do with these degrees of freedom once you compute them? It's necessary to ask because "degrees of freedom" has at least three possible distinct meanings in this context and can give rise to three different numerical answers.
– whuber
Jun 3 at 15:34
• @whuber That is very interesting to me. Would you point me to a source that describes these three distinct meanings, or briefly describe them? I wish to avoid overspecification. Jun 3 at 15:37
• stats.stackexchange.com/questions/16921/… Jun 3 at 15:40
• What are these three meanings to "degrees of freedom"? Jun 3 at 16:33
• See the top hits on this site related to degrees of freedom.
– whuber
Jun 3 at 17:02