Code Monkey home page Code Monkey logo

us-chartbook's People

Contributors

bdecon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

us-chartbook's Issues

Account for missing latest quarter

When the latest quarter is available for some charts but not others, the chartbook should indicate that the charts are showing additional information.

New text: NILF

Add text to describe chart showing NILF changes since March 2001.

FRB data not likely to update

Look into better ways to retrieve data from the Fed. I'm fairly sure the current code will not work to retrieve updates.

Structure of notebooks is not determined

To efficiently update the code, I want to run one command. This means I'll need to have a structured way to store the various individual chunks of code that update individual datasets or charts. Right now, there isn't really a structure to this.

Fix GDP by Industry

GDP by industry will be released for 2019 Q2 in mid October. This section was produced relatively manually and needs to be fixed/sorted at some point.

Error after GDP update

Getting duplicate data from the sql database for a few series. I suspect the BEA tables that were not updated by the advance estimate get duplicated in the database.

Net investment looks to include inventories

Pretty sure the meaningful concept here will be private gross investment minus depreciation and not including inventories or inventory valuation adjustments. Need to research it a bit.

Determining which text to generate

Fundamental to the new chartbook is having meaningful text. I can't manually intervene in the process often, so I want a simple way to decide which text to show and to create the text correctly.

A basic option so far has been:

"In latest_date, series ((contributed/subtracted) latest_value (to/from)/did not contribute to) GDP growth, (compared to a (contribution/subtraction) of 3yr_ma_value percentage points/and did not contribute) on average over the past three years."

But that won't work for series other than contribution to growth and also is a bit confusing and probably not always helpful.

What I eventually want is to evaluate the latest value compared to its time series and use that evaluation to determine which text to generate. Specifically, I am interested in short- medium- and long-term developments and figuring out when they are meaningful.

Simple examples to target would be:

  1. "((increased/decreased) by latest_value percentage points/was unchanged)"
  2. "(latest_value percentage points (higher/lower)/unchanged)"
  3. "((increased/decreased) to)/was unchanged at) latest_value"
    etc.

Some more advanced options:

  1. Ideally, for some series, calculate the latest value and the last time it was that high/low. If that was more than X ago then use that line of text "(highest/lowest) since last_time_date"

  2. Some cases have large recent changes: "an (increase/decrease) of change_value percentage points since reference_date"

  3. Deciding when to use a different word, for example: near 0 change could be "virtually unchanged", or very large changes "a large (increase/decrease) of ..."

Restructure code to separate collection and processing

Data collection structured by report/release.

Data processing--separate charts and text processing. Each chart must be of a identified chart type which has its own function. Charts each have their own notebook cell and name. Text handled based on chartbook section/topic/use cases to allow for more flexibility.

Age maps generated manually

Convert the code that generates the age maps to a loop that produces both. Currently, each must be created manually.

Use modules for each data source

Notebooks are not the answer for the final version of the chartbook. I need to move each data source's code into a self-contained .py file. Try this out with industrial production.

New text: Wealth to GDP - other

The other category in US wealth is huge. It also is complicated because it handles the foreign sector balance. Try to make better sense of what is going on and include a paragraph to describe it.

Analyze shift to services

It's not clear to me what people mean when they say the US economy is shifting to services. On one hand, clearly production of goods has been outsourced relative to the past.

But also, there's a shift towards spending a much larger share of the national income on health and education. Yet the health indicators aren't improving and while increased education does increase wages, wages haven't been going up as quickly as in the past.

Consistent price adjustments

I've been inconsistent in applying price adjustments, often using the PCE deflator when my general preference is for the CPI-U. At some point I will need to address this, and be more consistent in which deflator is used.

Numbering system for each chart (and section?)

Linking charts and tables to references would benefit from some structure/identification system beyond the name of the chart. Perhaps each chart can have a number like C1.1, C1.2, ..., C2.1, ... based on the section number. Tables would be T1.1...

The key would be automating the generation of each number and the link to the legend and references.

Externalize graphics

Running the chartbook with only one half of the first section complete is already slow and in need of help from externalizing the graphics. Will need to figure out a good way to do this.

Business section - chart on expenses

I'd like to know how expenses have been changing for US businesses. No idea on the source but ideally would want to know: labor, materials, capital, tax, and financing costs.

Improve personal income section

Add several charts to the personal income section. The obvious ones are for welfare and capital income by source. But more importantly try to make one good chart showing the distribution, possibly sourced from the CPS ASEC. Look at some past examples from Matt Bruenig, who has some of the clearest thinking on the topic.

Store data and metadata in pickle file or sql database or similar

The use of csv files for storing API returned data will not scale well and doesn't allow for storing metadata.

I'll need to figure out a structured way to store the API returned data and metadata. In past experience, a pickle file would probably work but SQL would give me a lot of powerful options. For example, I would eventually like to build in some features that tell me whether data has been updated recently and that also prevents a situation where good data is overwritten by empty or broken data.

A key consideration, though, needs to be ease of use later on. The current csv approach makes it very easy to get a variable into memory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.