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

Add function to get backward and forward linkages in any model #295

Open
bl-young opened this issue May 28, 2024 · 3 comments · May be fixed by #331
Open

Add function to get backward and forward linkages in any model #295

bl-young opened this issue May 28, 2024 · 3 comments · May be fixed by #331
Assignees
Labels
enhancement New feature or request

Comments

@bl-young
Copy link
Collaborator

Ghosh matrices (B and G in Miller and Blair 2nd ed. Ch12) provide the equivalent to A and L Leontief matrices for downstream effects (as opposed to upstream).

@bl-young bl-young added the enhancement New feature or request label May 28, 2024
@WesIngwersen
Copy link
Collaborator

This issue suggests addition of Ghosh matrices to model object. But at this point in this code
its only a needed to compute getSectorLinkages(). Rename this issue to rescope it until the time when we want it to be part of the model object.

@WesIngwersen WesIngwersen changed the title add Ghosh matrices Add function to get backward and forward linkages in any model Jan 31, 2025
@WesIngwersen
Copy link
Collaborator

WesIngwersen commented Jan 31, 2025

  q <- model$q # total commodity output
  x <- model$x # total industry output
  A <- model$A
  if(model$specs$CommodityorIndustryType == "Commodity") {
    B <- solve(diag(q)) %*% A %*% diag(q)
  } else if(model$specs$CommodityorIndustryType == "Industry") {
    B <- solve(diag(x)) %*% A %*% diag(x)
  }
  • Implement option to handle parameter use_domestic_requirements

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

Successfully merging a pull request may close this issue.

3 participants