Thank you.
That clarified the use of this method me.
This part allowed me to visualize what the equation is doing.
"Of course, these two models are equivalent. But in the first one, instead of having a zone-specific effect, you have an average effect (b0) and the departure from this average effect for each climate zone. Indeed, it is the same thing to say that the temperature in Paris is 10 degrees and -40 degrees in Moscow or to say that the average temperature is -15 with a difference of +25 for Paris and -25 for Moscow (though the second formulation is generally less commonly used in weather reports...)"
Original Message:
Sent: 08-14-2015 01:46
From: Hadrien Charvat
Subject: Question about example in Linear Models for Functional Responses
Dear Mr Ma,
I think I can offer a few elements of answer to your question.
In order to simplify the problem (because we do not really need to be discussing functional analysis to be confronted to your problem) let us forget about the time dependency of your model parameters.
First of all, let us consider only two climate zones. The model can then be written something like this:
y_i = b0 + x1i*b1 + x2i*b2 + e_i
You have also the requirement that each city is in only one climate zone, so you know that (x1i, x2i) is either (0,1) or (1,0). In other words, if city i is in climate zone 1, the predicted temperature is (b0 + b1) and if it is in climate zone 2, it is (b0 + b2).
As you can see, you are using 3 parameters (namely, b0, b1 and b2) for specifying the temperatures of only 2 climate zones. That means that there must exist a constraint between your three parameters otherwise, the model would not be identifiable...
At this point, note that you could have parameterized your model differently. You could have wanted to estimate the following model:
y_i = x1i*c1 + x2i*c2 + e_i
I think this is actually the way people would think about the problem if they had not heard about intercepts...With this model, the estimated temperature in climate zone j is simply cj.
Of course, these two models are equivalent. But in the first one, instead of having a zone-specific effect, you have an average effect (b0) and the departure from this average effect for each climate zone. Indeed, it is the same thing to say that the temperature in Paris is 10 degrees and -40 degrees in Moscow or to say that the average temperature is -15 with a difference of +25 for Paris and -25 for Moscow (though the second formulation is generally less commonly used in weather reports...)
Algebraically, you have:
c1 = b0 + b1
c2 = b0 + b2
But b0 is the average temperature of the two climate zones, so in fact: b0 = 1/2*(c1 + c2)
Replacing in the previous equations, you get:
b1 = 1/2*(c1-c2)
b2 = 1/2*(c2-c1)
so that: b1 = -b2 or b1 + b2 = 0 QED
In the case of n climate zones, the argument is the same:
c_j = b_0 + b_j with b_0 = (1/n)*(c_1 +...+ c_n)
So that b_j = (1/n)*((n-1)*c_j - c_1 -...- c_(j-1) - c_(j+1) -...- c_n) for j in 1,...,n
And eventually, you can check that it implies that b1 +...+ bn = 0.
Now, the authors propose a simple way to include this constraint in their model by using a pseudo-observation. This is just a computational trick.
Well, they say that you have to add an observation with y = 0 but it is a little bit more than that. You should understand what they did if you look at the code given on page 148 of the book you cite. In fact, the complete pseudo-observation that is added is the following:
y x0(Intercept) x1 x2 x3 x4
0 0 1 1 1 1
So, even if you know that it is impossible for a real observation to have all x's (except the intercept) equal to one (that means a city belonging simultaneously to all climate zones), it is still possible to use such a pseudo-observation to "trick" the algorithm into understanding that:
y_36 = x1_36*b1 + x2_36*b2 + x3_36*b3 + x4_36*b4
Which, in fact, evaluate to: b1 + b2 + b3 + b4 = 0
I think that you should be able to do the same thing without the extra pseudo-observation, by using contrasts.
I hope that it helps you, at least partially...
Yours sincerely,
hadrien
------------------------------
Hadrien Charvat
------------------------------
Original Message:
Sent: 08-12-2015 10:18
From: Tianwen Ma
Subject: Question about example in Linear Models for Functional Responses
I am reading Chapter 10 Linear Models for Functional Responses of Functional Data Analysis with R and Matlab by Ramsay.
On page 148, the book mentions the model for "Climate Region Effects on Temperature".
> $y_i(t)=\beta_0(t)+\sum_{j=1}^4 x_{ij} \beta_j(t) + \epsilon_i(t)$ --- (10.1)
where i refers to the index of 35 Canadian cities; the response variable is the functional response of daily temperature; j refers to the index of four climate zones: Atlantic, Pacific, Prairie and Arctic.
In this case, the values of $x_{ij}$ are either 0 or 1. If the 35 by 5 matrix $\mathrm{Z}$ contains these values, then the first column has all entries equal to 1, which codes the contribution of the Canadian mean temperature; the remaining four columns contain 1 if that weather station in the corresponding climate zone and 0 otherwise. In order to identify the specific effects of the four climate zones, we have to add the constraint
>$\sum_{j=1}^4 \beta_j(t)=0$ for all t --- (10.2)
And one of the methods of imposing such constraint is to add the above equation as an additional $36^{th}$ "observation" for which $y_{36}(t)=0$.
I am fine with the model introduction, but I am a little confused why we should take (10.2) into consideration and why adding $y_{36}(t)=0$ is the way to imposing such constraint.
Thank you for your help in advance.
------------------------------
Tianwen Ma
Student
University of Michigan Ann Arbor
------------------------------