Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downstream sales coefficient calculations (and Ghosh) #145

Open
rich-wood opened this issue Aug 12, 2024 · 3 comments
Open

downstream sales coefficient calculations (and Ghosh) #145

rich-wood opened this issue Aug 12, 2024 · 3 comments

Comments

@rich-wood
Copy link
Contributor

rich-wood commented Aug 12, 2024

@Beckebanze
It seems that the Ghosh implementation in pymrio is transposed to normal? As is transposed (G is calculated correctly). As should be sales coefficients – so along a row, how much of the sale of commodity A to total sales of commodity A. If a fix is generated, great if you can use conventional nomenclature (B instead of As).

See p543 and so on of miller and blair

sorry, formatting of py code is off...
`
import pymrio
import numpy as np

load the test system

io = pymrio.load_test()

calculate the basic parts of the system

io.calc_all()

we need value added, but the test system doesn't have an explicit value added - so we generate it as the different between total output(=total input) and intermediate inputs

io.v=io.x.T - io.Z.sum(axis=0)

standard Ghosh

x=[email protected]
print(x.T-io.x)

alt standard method is

x=[email protected]
print(x-io.x)

why transpose? this works

x=[email protected]
print(x.T-io.x)

why transpose? this works

x=[email protected]
print(x-io.x)
`

@Beckebanze
Copy link
Contributor

Happy to change As to B in my next pull request (it's in fact already on my to-do).

Regarding the definition of the Ghosh inverse: I am aware that it is the transpose compared to the definition in several papers in literature, including Miller and Blair. For value-added (v) and final-demand (y) methods, it is convenient to work with L.dot(y) and v.dot(G). However, for the combined upstream and downstream footprint of some economic activity it is somewhat cumbersome to have the upstream footprint vector vertically and downstream horizontally. The total footprint(s) of satellite account(s) F of any economic activity expressed in terms of vertical revenue-vector r can now be expressed as F.dot(L+G-I).dot(r).
Personally, I prefer to call the L and G in this expression in 'Leontief and Ghosh inverses'. Using the transpose of this for G makes the expression less elegant, because then the transpose of the Ghosh inverse has to be used at all times. If you still think it is better to implement the transpose of the current implemented G, then happy to do so as well with my next PR.

@rich-wood
Copy link
Contributor Author

Hi, I'd say it is best to keep consistency to established methods. It gets too confusing if there are slightly different implementations. Not everyone will use the sales coefficients and Ghosh in the way you do. For your implementation, it is still pretty straightforward, as you just need to transpose G when using it: F.dot(L+G.T-I).dot(r). That'd have to be easier right?

@Beckebanze
Copy link
Contributor

I changed the implementation for Ghosh accordingly with PR #146.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants