This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source('basefn2.R', encoding='UTF-8') | |
# Path to original = https://github.com/brianr747/platform/blob/master/legacy/R/c20190502_greek_GDP.R | |
ser <- pfetch("D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL") | |
p2 <- PlotLowLevel1(ser/1000,"Bn. EUR","Greek Nominal GDP") | |
p2 <- SetXAxis(p2,"1997-01-01", 2) | |
PlotFromLowLevel(p2,"c20190502_greek_GDP.png","Eurostat via DB.nomics") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2019-05-10 22:42:34 INFO Starting | |
2019-05-10 22:42:34 DEBUG Fetching D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL | |
2019-05-10 22:42:34 DEBUG Starting new HTTPS connection (1): api.db.nomics.world:443 | |
2019-05-10 22:42:34 DEBUG https://api.db.nomics.world:443 "GET /v22/series?observations=1&series_ids=Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL&offset=0 HTTP/1.1" 200 None | |
2019-05-10 22:42:34 INFO Writing D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL | |
2019-05-10 22:42:34 INFO Load loop | |
2019-05-10 22:42:34 DEBUG Fetching D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL from Text File Database | |
2019-05-10 22:42:34 DEBUG Fetching D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL from Text File Database | |
2019-05-10 22:42:34 DEBUG Fetching D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL from Text File Database | |
2019-05-10 22:42:34 DEBUG Fetching D@Eurostat/namq_10_gdp/Q.CP_MEUR.SCA.B1GQ.EL from Text File Database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
recession_random_walk.py | |
This file has nothing to do with pricing applications, it's just code that generates charts | |
for a random walk simulation of recessions. The explanation of what I am doing will appear in an | |
article on my website, and in my upcoming book on recessions. | |
""" | |
import random | |
from statistics import mean | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ex20171127_equations_state_space_models.py | |
And now for something completely different... | |
This code just uses the equation parser and solver to generate the solutions for state space models. | |
One of the stranger applications of framework code... | |
""" | |
from sfc_models.equation_solver import EquationSolver | |
from sfc_models.examples.Quick2DPlot import Quick2DPlot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from sfc_models.gl_book.chapter3 import SIMEX1, SIM | |
from sfc_models.examples.Quick2DPlot import Quick2DPlot | |
builder_SIMEX = SIMEX1(country_code='C1', use_book_exogenous=True) | |
model = builder_SIMEX.build_model() | |
model.main(base_file_name=os.path.join('output','ex20170209_SIMEX1')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ex20161128_tax_cut_comparison.py | |
Extend the SIM model (Godley and Lavoie, Chapter 3) with a capitalist sub-sector, | |
and then look at the effect of a tax cut. | |
Copyright 2016 Brian Romanchuk | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ex20161103_SIM_2_country.py | |
Build a modified SIM model (G&L Chapter 3) for two countries, one with non-zero profits, | |
using sfc_model classes. | |
Copyright 2016 Brian Romanchuk | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works on Version 0.2.1 of sfc_models... | |
from sfc_models.models import * | |
from sfc_models.sectors import * | |
# Create model, which holds all entities | |
mod = Model() | |
# Create first country - Canada. (This model only has one country.) | |
can = Country(mod, 'Canada', 'CA') | |
# Create sectors | |
gov = DoNothingGovernment(can, 'Government', 'GOV') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
run_SIM_machine_generated.py | |
Script to generate model SIM from [G&L 2012] from text equation specification. | |
""" | |
from plot_for_examples import Quick2DPlot | |
import sfc_models.iterative_machine_generator as generator | |
filename = 'SIM_model.py' |