Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 2.01 KB

README.md

File metadata and controls

45 lines (33 loc) · 2.01 KB

Prediction of Supply and Use Tables based on Nonlinear Optimization

Implementation of nonlinear optimization methods for prediction of Supply and Use Tables (SUTs) using historical data.

Contents of the repository

Requirements

  • numpy >= 1.17.4
  • scipy >= 1.3.1

Installation

Copy the 'MethodsFromArticle' folder to your project folder.

Example

import numpy as np
from MethodsFromArticle import predict
from MethodsFromArticle import predict_grad

# Initial supply or use matrix
sup10 = np.load('data//sup10.npy')
# Constraint vectors — summation by rows and columns
sup11 = np.load('data//sup11.npy')
u = np.sum(sup11, axis=1)
v = np.sum(sup11, axis=0)

# Available methods for prediction:
#   INS - Improved Normalized Squared Difference
#   IWS - Improved Weighted Square Differences
#   ISD - Improved Square Differences
#   RAS - RAS method
pred_sup11 = predict(sup10, u, v, method='INS')

# Proximal gradient method
pred_sup11 = predict_grad(sup10, u, v)