This project obtains data from the Central Bank of Armenia's open API, covering the data from a specified start date for any of the 30 supported currencies.
ISO | Currency | ISO | Currency |
---|---|---|---|
USD | US Dollar | GBP | British Pound Sterling |
AUD | Australian Dollar | EUR | Euro |
XDR | IMF Special Drawing Rights | IRR | Iranian Rial |
PLN | Polish Złoty | CAD | Canadian Dollar |
INR | Indian Rupee | NOK | Norwegian Krone |
JPY | Japanese Yen | SEK | Swedish Krona |
CHF | Swiss Franc | CZK | Czech Republic Koruna |
CNY | Chinese Yuan (Renminbi) | SGD | Singapore Dollar |
BRL | Brazilian Real | AED | UAE Dirham |
KGS | Kyrgyzstani Som | KZT | Kazakhstani Tenge |
RUB | Russian Ruble | UAH | Ukrainian Hryvnia |
UZS | Uzbekistani Som | BYN | Belarusian Ruble |
TJS | Tajikistani Somoni | GEL | Georgian Lari |
HKD | Hong Kong Dollar | XAU | Gold (troy ounce) |
XAG | Silver (troy ounce) | NZD | New Zealand Dollar |
The data is then processed using linear regression to forecast exchange rate, which is compared with the actual rate.
To install the necessary dependencies, once you've cloned the repo, cd to the directory in which 'requirements.txt' is located, and run
pip3 install -r requirements.txt
Before proceeding, make sure to configure the exchange rate data fetching. In the exchange_rate_data/data_fetcher.py
file, specify the ISO code of the desired currency and the start date in the format YYYY-MM-DD:
iso_codes = 'USD'
start_date = '2023-09-01'
Once you've configured the data fetcher, you can run the application as follows:
python3 main.py
After executing the application, it will produce a graphical representation illustrating exchange rates, linear regression analysis, and a forecast.
Linear regression represents a regression model that describes the relationship between one (dependent) variable and one or more other variables (factors, regressors, independent variables) with a linear functional dependency. Let's consider a linear regression model in which the dependent variable depends on only one factor. In this case, the function describing the relationship of
The task is to find the weight coefficients
Or, by substituting the model equation:
Minimizing the
Setting these derivatives to zero yields a system of equations whose solution minimizes the
Expanding the sums and taking into account that
We express
Substituting this into the second equation, we solve for
By solving for