Closed caleb-petry closed 2 years ago
Caleb, is it ok if we use POWERGPI? which is not exactly the same as POWER in IFs. I want to use it because we already have a saved variable for the GPI one. In any case this will be lagged by one year.
Unfortunately, I don't think it would work with POWERGPI as is. The measures are quite different in their components and weights. DiME/POWER also aligns more with our present mental model and avoids some colinearity. That said, the correlation between the two power measures is quite strong.
If it is significantly easier to use, I could ask Collin to switch DiME/POWER out for POWERGPI - but he is out today.
Not a problem Caleb, I will create the required saved variable for the POWER variable. Are you aware that back in Apri of 2021 we renamed POWER to POWERHH in the code, this was a request by Jonathan. Anyway, this usually confuses me on which is which, but following the descriptions it should be POWER, the one that is DiME.
I am just confirming that I am aware and that it should be POWER, as you already noted. Thanks!
I have completed the implementation of this one, and it's ready for review. Please check that the formulas in the Issue Tracking System are ok, I think when you pasted the e-mail some "\" were introduced, so I assume all "*" are in reality just "*". Here are the .NET files I changed, and you will need to download the bilateral forecast file:
https://ifs02.du.edu/BilateralInteractionData/IFsForDyadic%2020220419.zip
You are correct. I had to add an escape character to avoid italics... But, it looks like it added them in the text for some reason (maybe when I made it embedded code?).
I'll take a look this evening or tomorrow and let you know how it looks.
Feature added; with data update performs well according to specification.
May need .Dat/base scenario changes to correct unexpected (but in line with model) behavior such as China opening an embassy in Taiwan.
Text From Email Thread: FBIC in IFs: Adding Monadic Constraints and Forecasts To Dyadic LOR
To continue from our call, the following is an outline of what we want to add to the model. In addition to this, we would like to add POLITYAFFINITY as another new bilateral variable, have a saved version of LoR for use in the regression, move the xdyadlorm/dyadloradd parameters to lorscore so that they work within the monadic reconciliation, and add a parameter to set exogenously the monadic embassy value. Attached here are updated embassy series, which I will send to Yutang.
Predicted Shift Logic
Initialize LoR from data; It should equal the monadic else we have a data issue (No changes needed)
Generate ranked propensity scores using:
z = -6.610434 + (8.361949\*SLOR) + (-0.0001667\*DISTANCE) + (10.11272\*POWERactor) + (10.84424\*POWERPartner) + (0.0192345\*POLITYAFFINITY) + (0.2697322\*[ POWERactor \*POLITYAFFINITY]) + (0.1356601\*[ POWERPartner\*POLITYAFFINITY]) + (0.0569043\*LNGDPPCPActor) + (0.2907447\*LNGDPPCPPartner)
lorscore = xdyadlorm * (Exp(z) / Exp(1+z)) + dyadloradd
In later years, assign shifts (WHILE DIPLOEMBASSY - sumOfDyadicLoRForActor > 0|DIPLOEMBASSY – sumOfDyadicLoRforActor < 0) using the ranked scores.
For an increasing DIPLOEMBASSY, increase the highest scores’ (where LoR is not 1) LoR values to 1 until the difference is less than 1 minus the next highest lorscore’s LoR value then add the remaining monadic LoR surplus to that dyad’s LoR. If the monadic increases above 185, do not apply any increases.
For a decreasing DIPLOEMBASSY, decrease the lowest scores’ (where LoR is not 0) LoR values to 0 until the absolute difference remaining is less than the next lowest lorscore’s LoR value then remove the remaining monadic LoR deficit from that dyad’s LoR.
Intended Behavior An increase of 1 DIPLOEMBASSY with 3 dyads; values 0.75, 0.5, .1; lorscore 0.9, 0.5, 0.3 = Final LoR values: 1, 1, 0.4 An increase of 1 DIPLOEMBASSY with 3 dyads; values 0.75, 0.5, .1; lorscore 0.3, 0.5, 0.9 = Final LoR values: 0.75, 0.6, 1 A decrease of 1 DIPLOEMBASSY with 3 dyads; values 0.75, 0.5, .1; lorscore 0.9, 0.5, 0.3 = Final LoR values: 0.55, 0, 0 A decrease of 1 DIPLOEMBASSY with 3 dyads; values 0.75, 0.5, .1; lorscore 0.3, 0.5, 0.9 = Final LoR values: 0, 0.25, 0.1
New Variables
POLITYAFFINITY = 20 – abs(DEMOCPOLITYActor – DEMOCPOLITYPartner)
SLOR (or equivalent)
Parameters
New: setdiploembassy; exogenously replace DIPLOEMBASSY
Moved: xdyadlorm/dyadloradd; moved to lorscore