Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Constrained minimization of an objective function

    Starting from an initial table which provides at the time period t=0 the GDP by region (i) and industry (j), i.e., GDP0i,j.
    At the time period t=1, I have just the GDP by region (GDP1i), on the one hand, and the GDP by industry (GDP1j), on the other hand.
    My aim is to estimate the GDP by all combinations of region and industry, i.e., GDP1i,j.

    Using mstdize from SSC, which is an iterative procedure of biproportional adjustment of rows and columns (developed by Nicholas Cox), I was able to achieve my goal:

    clear*
    input RGN IND GDP0
    1 1 20900
    1 2 10100
    1 3 23700
    2 1 15100
    2 2 12600
    2 3 42600
    3 1 1600
    3 2 2100
    3 3 13800
    4 1 10600
    4 2 12100
    4 3 18300
    end
    bysort RGN: egen TotGDP0_RGN = total(GDP0)
    bysort IND: egen TotGDP0_IND = total(GDP0)
    sort RGN IND

    qui gen TotGDP1_RGN = .
    tokenize 56700 68300 19000 38500
    qui forval i = 1/4 {
    replace TotGDP1_RGN = ``i'' if RGN == `i'
    }
    gen TotGDP1_IND = .
    tokenize 58200 41900 82400
    qui forval j = 1/3 {
    replace TotGDP1_IND = ``j'' if IND == `j'
    }
    mstdize GDP0 TotGDP1_RGN TotGDP1_IND, by(RGN IND) gen(GDP1)

    Click image for larger version

Name:	Picture1.GIF
Views:	1
Size:	3.2 KB
ID:	1470457


    However, mstdize does not offer the possibility of minimizing an objective function while producing the target new table such as the Entropy function or the minimum square deviation function. Further, in many instance, we may have (from historical data) some lower band of GDP for different combinations (i, j). Thus, I am wondering whether there is a way with STATA to minimize an objective function conditional on (1) the target new row totals; (2) the target new column totals, and (3) the lower band of each component we may know.

    Click image for larger version

Name:	Capture2.GIF
Views:	1
Size:	11.3 KB
ID:	1470458



    Many thanks in advance for your help!
Working...
X