User Tools

Site Tools


howtos:feedback:tracking_method_-_deviation_ratio_multiplier

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
howtos:feedback:tracking_method_-_deviation_ratio_multiplier [2011/05/02 19:01]
shona.weldon created
howtos:feedback:tracking_method_-_deviation_ratio_multiplier [2012/10/10 14:53] (current)
shona.weldon
Line 5: Line 5:
  
 <​file>​ <​file>​
-creview USDomFDperPerson[com,ts][]+view simTotEU[rr,dts,​rfts->​reu,​th][] 
 +view RESDTotEnrUseWAdj[rr,​rfts,​th][]
  
-view USGDPConDollar[esect,ts][]+! variables to change 
 +creview bulbPerDwellExo[rr,​dts,​bt,​th][] 
 +creview useExoBulbPerDwell[][] 
 +view bulbsPerDwell[rr,dts,bt,th][]
  
 +creview minorApplPRExog[rr,​dts,​minat,​th][]
 +creview useExoMinApplPenRate[][]
 +view minorApplPR[rr,​dts,​minat,​th][]
  
-integer $trackStartYr = 2010 +creview majorApplPenRateExo[rr,mac,th][] 
-integer $trackEndYr = 2035 +creview useExoMajApplPenRate[][] 
-integer $lastScnYr  +view majorApplPenRate[rr,mac,th][]
-getobjinfo (USGDPConDollar[esect,ts][2], $lastScnYr; info=sequenceEnddim=time)+
  
-keep varTarget[tsTrack]+integer $trackStartYr 
 +integer $trackEndYr 
 +getobjinfo (bulbPerDwellExo[rr,​dts,​bt,​th][1],​ $trackStartYr;​ info=sequenceStart,​ dim=time) 
 +getobjinfo (bulbPerDwellExo[rr,​dts,​bt,​th][1],​ $trackEndYr;​ info=sequenceEnd,​ dim=time) 
 + 
 +integer $lastScnYr 
 +getobjinfo (bulbPerDwellExo[rr,​dts,​bt,​th][1],​ $lastScnYr; info=sequenceEnd,​ dim=time) 
 + 
 +keep varTarget[upperDims,​time]
  
 say ("​Iteration:​ ", $fbViewIteration) say ("​Iteration:​ ", $fbViewIteration)
 if ($fbViewIteration == 1) if ($fbViewIteration == 1)
- string $importEIAData + ! ** BEGIN USER MUST ADJUST HERE ** 
- buildstring ($importEIAData,​ $home, "/​primaryData/​energyConsumption/​EIARefCase"​) + ! NOTE I did 2 extracts so that I didn't shrink time out in case there is only 1 tracking year 
-  + varTarget[upperDims,​time] = extract ​(extract ​(RESDTotEnrUseWAdj[rr,rfts,th]; \ 
- say ("​Importing EIA GDP to track on") + resFuelTypeSim:​electricityshrink=on); \ 
- local EIAUSGDPConDollarTotalx[ts] =  ​changeseq ​(copyshape ​(sum (USGDPConDollar[esect,ts][2]; \ + time:​$trackStartYr..$trackEndYr) 
- dim=econSector));​ \ + ! **END
- dim=timestart=2008, end=$trackEndYr) +
-  +
- EIAUSGDPConDollarTotalx[ts] = import (dataFormat="​odometer",​ delimiter=",",​ firstLine=5,​ lastLine=5, ignoreExtraCols=on, ​+
- rowTitles=on,​ file=$importEIAData/​AEO2011-Industrial_Sector_Macroeconomic_Indicators-AEO2011_Reference_Case.csv) +
-  +
- local EIAUSGDPConDollarTotal[ts] = EIAUSGDPConDollarTotalx[ts] * 1e9 +
-  +
- varTarget[tsTrack] = extract (EIAUSGDPConDollarTotal[ts]; ​time:​$trackStartYr..$trackEndYr) +
 endif  endif 
  
-local varLI[tsTrack] = extract (sum (USGDPConDollar[esect,ts][2]; dim=econSector); time:​$trackStartYr..$trackEndYr) +! ** BEGIN USER MUST ADJUST HERE ** 
-local devRatio[tsTrack] = varTarget[tsTrack] - varLI[tsTrack] / varTarget[tsTrack] +local varResultLI[upperDims,tsTrack] = extract (extract (sum (simTotEU[rr,dts,​rfts->​reu,​th]; 
-!table (devRatio[tsTrack],​ varTarget[tsTrack], ​varLI[tsTrack]; overlay=on) + dim1=rftsCOreu@resFuelTypeSim,​ dim2=dwellingTypeSim); 
-local creVarLI[com,ts]+ resFuelTypeSim:​electricity,​ shrink=on); \ 
 + time:​$trackStartYr..$trackEndYr) 
 +! **END 
 + 
 +local devRatio[tsTrack] = varTarget[tsTrack] - varResultLI[tsTrack] ​ / varTarget[tsTrack] 
 +!table (devRatio[tsTrack],​ varTarget[tsTrack], ​varResultLI[tsTrack]; overlay=on) 
 +!display (devRatio[tsTrack]) 
 + 
 + 
 +! ** BEGIN USER MUST ADJUST HERE **  ! NOTE sometimes it's different between the first and subsequent iterations 
 +local crevarResultLI_var1[upperDims,time] 
 +local crevarResultLI_var2[upperDims,​time] 
 +local crevarResultLI_var3[upperDims,​time]
 if ($fbViewIteration == 1) if ($fbViewIteration == 1)
- creVarLI[com,ts] = USDomFDperPerson[com,ts][2]+ crevarResultLI_var1[upperDims,time] = bulbsPerDwell[rr,dts,​bt,​th][1] 
 + crevarResultLI_var2[upperDims,​time] = minorApplPR[rr,​dts,​minat,​th][1] 
 + crevarResultLI_var3[upperDims,​time] = majorApplPenRate[rr,​mac,​th][1]
 else else
- creVarLI[com,ts] = USDomFDperPerson[com,ts][3]+ crevarResultLI_var1[upperDims,time] = bulbsPerDwell[rr,dts,​bt,​th][2] 
 + crevarResultLI_var2[upperDims,​time] = minorApplPR[rr,​dts,​minat,​th][2] 
 + crevarResultLI_var3[upperDims,​time] = majorApplPenRate[rr,​mac,​th][2]
 endif endif
 +! **END
  
-local numNotConv[] = sum (boolgt (devRatio[tsTrack],​ $fbViewTolerance);​ dim=all)+local numNotConv[] = sum (boolgt ​(abs (devRatio[tsTrack]), $fbViewTolerance);​ dim=all)
 integer $numNotConv integer $numNotConv
 getobjinfo(numNotConv[],​ $numNotConv;​ info=dataElement) getobjinfo(numNotConv[],​ $numNotConv;​ info=dataElement)
Line 58: Line 80:
   
  ! Set the outputs  ! Set the outputs
- USDomFDperPerson[com,ts][3] = creVarLI[com,ts+! ** BEGIN USER MUST ADJUST HERE **  ! NOTE sometimes it's different between the first and subsequent iterations 
- + bulbPerDwellExo[rr,dts,bt,th][2] = crevarResultLI_var1[upperDims,time] 
 + useExoBulbPerDwell[][2] = 1 
 + 
 + minorApplPRExog[rr,​dts,​minat,​th][2] = crevarResultLI_var2[upperDims,​time] 
 + useExoMinApplPenRate[][2] = 1 
 + 
 + majorApplPenRateExo[rr,​mac,​th][2] = crevarResultLI_var3[upperDims,​time] 
 + useExoMajApplPenRate[][2] = 1 
 +! **END 
  quit(0)  quit(0)
 else else
Line 65: Line 96:
 endif endif
  
 +! USER NOTE - this code implies a positive relationship between the variable you are changing and the result
 +!  for example, move up the input variable and expect the output to also move up.
 local multiplier[ts] = extend (min (max (devRatio[tsTrack],​ -0.5), 0.5) + 1.0; dim=time, end=$lastScnYr) local multiplier[ts] = extend (min (max (devRatio[tsTrack],​ -0.5), 0.5) + 1.0; dim=time, end=$lastScnYr)
-USDomFDperPerson[com,​ts][3] = creVarLI[com,​ts] * multiplier[ts] 
  
-quit(1) +! ** BEGIN USER MUST ADJUST HERE **  ! NOTE sometimes it's different between the first and subsequent iterations 
-</file?+bulbPerDwellExo[rr,​dts,​bt,​th][2] = crevarResultLI_var1[upperDims,​time] * multiplier[ts] 
 +useExoBulbPerDwell[][2] = 1
  
 +minorApplPRExog[rr,​dts,​minat,​th][2] = crevarResultLI_var2[upperDims,​time] * multiplier[ts]
 +useExoMinApplPenRate[][2] = 1
 +
 +majorApplPenRateExo[rr,​mac,​th][2] = crevarResultLI_var3[upperDims,​time] * multiplier[ts]
 +useExoMajApplPenRate[][2] = 1
 +! **END
 +
 +quit(1)
 +</​file>​
howtos/feedback/tracking_method_-_deviation_ratio_multiplier.1304362914.txt.gz · Last modified: 2011/05/02 19:01 by shona.weldon