| Algorithm A1. Reverse Regression |
|
Input: Dependent variables data y, other independent variables data othervar, the number of iterations NI, initial share factor data sharefactor, the number of iterations NRI, Maximum and minimum values assumed for sharefactor variable mins and maxs. LD = The number of dependent variables |
|
foriin 0 to LD: for i2 in 0 to NI: for i3 in 0 to NRI: n = Generate a random number from 0 to the length of sharefactor data for i4 in mins to maxs: Convert the nth value of sharefactor to i4. Calculate the goodness-of-fit of the regression of othervar and sharefactor on the y (Equation (5)). Obtain the sharefactor with the highest r2. Obtain NI sharefactor with the highest r2. Obtain the LD * NI matrix of sharefactor with the highest r2. SFMATRIX = the LD * NI matrix of sharefactor with the highest r2 for i1 in 0 to LD: for i2 in the i1th column of SFMATRIX: for i3 in numbers from 0 to LD except i1: for i4 in the i3th column of SFMATRIX: Calculate the r2 of i2 and i4 Obtain i4 with highest r2 Obtain LD—1 sharefactor that are most similar to the trend of i2 in all columns except for column i1. Each sharefactor, in the i1th column of SFMATRIX, gets LD—1 sharefactor that are most similar to it Each sharefactor, in SFMATRIX, gets LD—1 sharefactor that are most similar to it SIMLARM = LD * NI matrix of sharefactor with similar trends among different dependent variables Choose the most similar trend in SIMLARM. |
| Output:Sharefactor with the most similar trend among different dependent variables |