In this subsection we give the derivation of the transformation that will take the original data set into a homogeneous band wherein we can use regression techniques to estimate parameters во, в1 inEq. (8.3).
Define a set of ordered pairs fa, y,), i = 1,…,n, where x, represents the clearness index kt and y, represents the diffuse fraction dt. Discretise the y values into к sub-intervals of equal size. The value of k ranged between 50 and 100 for various locations, depending on the number of points and the ability of the software we used, Matlab, to handle the transformation. Write
y = Ua (8.4)
y ■ 1 = 0 (8.5)
y ■ y = 1 (8.6)
where a, which is к x 1, records the bin scores and U, which is n x k, is the incidence matrix. An incidence matrix is a matrix that shows the relationship between X and y, the matrix has one row for each element i of X and one column for each element j of y. The entry in row i and column j is 1 if x and y are related (called incident in this context) and 0 if they are not.
The constraints Eqs. (8.5) and (8.6) are present to allow the data to be standardised. This means the data is centred around zero (Eq. (8.5)) with a constant variance of unity (Eq. (8.6)).
The regression model in matrix form is y = XT в + є, and using least squares, the residual sum of squares is
£T є = (y – X p)T (y – Xp) (8.7)
The ordinary least squares problem is to find the best estimate p to minimise єтє. Therefore the problem is to find
штєт є = (y – Хр )T (y – Xp)
= (yT – p TXT )(y – Xp)
= /y – p TXTy – yTXp + p TXTXp (8.8)
But, from the theory of regression, the best estimate for the parameters is в = (XTX)-1XTy, from which we also get pT = yTX[(XTX)-1]T. Substituting these into Eq. (8.8), we get
min £T є = yTy – yTX (XTX )-1XTy – yTX [(XTX)-1]TXTy +УХ [(XTX )-1]TXTX (XTX )-1XTy = yTy – yTX (XTX )-1XTy – yTX [(XTX)-1]TXTy +yTX [(XTX )-1]TXTy = yTy – yTX (XTX )-1XTy
= yT [I – X(XTX)-1XT]y (8.9)
If we write PX = X(XTX)- 1XT, then we obtain
тіпє1′ є = yr (I – PX )y = yry – yTpXy
= 1 – yTPXy (8.10)
PX is called the projection matrix. The problem is to minimise the residual sum of squares єТє, but єтє > 0 ^ 1 – yTPXy > 0. Therefore, yTPXy < 1 and the problem becomes to
The method of Lagrange multipliers takes a problem with objective function plus constraints and converts it such that the constraints enter the objective function that is to be minimised or maximised. Now, by introducing the Lagrange multipliers A1 and A2 for each constraint Eqs. (8.5), (8.6) a linear combination is formed involving the multipliers as coefficients. The objective for the optimisation is expressed as
max yTPXy + AiyT 1 + X2(yTy – 1) (8.12)
In terms of a, the constraints are
and mj is the number of elements in bin j. Thus
yTPXy = aTUTX (XTX )-1XTUa
= bT л-1^^ (XTX )-1XTUЛ-1/2й
G = A-l/2UTX (XTX)- 1XT UЛ-1/2 (8.17)
Now, by substituting these equations into the objective function it can now be written
maximize z = bTGb + A1vT b + A2bT b (8.18)
Further, we can derive vTG = 0. Hence v is an eigenvector of G for eigenvalue zero, and it can be shown that b is a leading eigenvector of G. Thus b can be found, hence a, the bin scores, is calculable.