Thursday, May 12, 2016

the long and variable project


looking at two time series on a graph ...
and i think they would look quite similar if i took the one series and lagged it

so I set up a table of dates:
lag the 2001 value to 2002
lag the 2003 value to 2004
lag the 2007 value to 2009
lag the 2011 value to 2013
lag the 2016 value to 2016

(that last one has no lag)

i am trying to have the computer figure everything out from this
to give me a graph showing the one series lagged per the table of dates.

doesn't sound conceptually difficult

but it seems to be.

i think i depend on the x-axis, the date-values, more than i realize.
i think the problem is like "the denominator problem" where you look at
for example the federal debt relative to gdp
and you see that it goes up
and you conclude that the federal debt went up
and nobody thinks about the changes in gdp.

i think it is like that.
i keep getting confused between lag-from dates and lag-to dates...
i just naturally think in terms of the y-axis values and changing those values
when really i don't want to change those values, just fit them to different dates
sometimes to impossible dates.

imp dates, i call them now. that about sums it up.

Wednesday, May 11, 2016

Where's Art?


I don't like it if I don't have a post every day. So I must have a reason, right? Well yeah: There's the lawn to mow...

Apart from that, I've been working on a little project that I thought would go quick, so that if I missed a day or two the tradeoff would be that I got the project done and then everything would be back to normal. But it's taking longer than I thought. So here's a progress report.

This morning there was an error in my Excel VBA code:


I clicked the DEBUG button to bring up the code with the error highlighted:


The roDate function takes the value ro (which is a row-number in my spreadsheet) and gives me back the date it finds in the date column on that row of the sheet.

But I don't think the error is in the roDate function. Because it was working until now. I think the error must be in the calling function, the part of the code that uses roDate to get the date from the spreadsheet.

See that yellow arrow in the margin, by the highlighted line? I dragged that arrow down a row to highlight the End Function line and clicked F8 to execute that one line of code. That brought me back to the calling code:


The highlighted line here is the next line after the line that calls the roDate function. VBA is still trying to work its way through the code, and mindlessly moves on to the next line. So I have to read the line that comes before the highlighted line:

currentDate = roDate(D, ro)

because that it is the one that uses my roDate function, the one we were looking at in the images above.

One line up from the currentDate line there is the For ro = dateRo line, and above that is the Dim firstData line. These are the lines I have to check.

Just like with the economy. If the thing crashed in 2008, you don't look for the cause in 2008. You look in the years before 2008.

So I hovered my mouse over the names of variables in those few lines of code. When you hover the mouse like that, a little tag pops up that tells you the value of the variable. When I hovered over the variable named firstData a tag popped up that said "firstData = 0.5".


But the value is supposed to be the date of the first unlagged value (as you can tell by reading the whole Dim firstData line).

The value is supposed to be a date. 0.5 is not a date. The DateOfFirstUnlaggedValue function doesn't give back a date. There's the problem.

So I went and looked at the DateOfFirstUnlaggedValue function.


As the highlighted line shows, the DateOfFirstUnlaggedValue function gets the value 0.5 from dt, the variable named dt. Aha! And one line up from there, the variable dt gets the value from the spreadsheet, the active sheet, from the cell at row number ro and column number D.UnlaggedCol.

That's gotta be where the problem is. I'm looking in the wrong column. I'm looking in the column of unlagged values instead of in the column of dates.

For reference, here's the part of the spreadsheet with the dates and values:


First column is dates. The other three columns are used to make three lines on a graph. The "lagged" and "unlagged" columns have the same values now. After I make the lagging work right, values on the "lagged" column will appear in later years or, in some cases, they will be different values altogether.

My code is looking in the UnlaggedCol (column 5) when it should be looking in the DateCol (column 1). As you can see, the row of data for 2001 has the value 0.50 in the UnlaggedCol. That's where that number came from.

So all I had to do to fix the problem -- after tracking it down, which is where the work is -- was to change D.UnlaggedCol to D.DateCol and that was it. Here it is, after the fix:



After making that change, the DateOfFirstUnlaggedValue function actually returns a date:


I put the mouse on the firstData variable, and the tag that popped up says 2001. What more could I ask?

Thinking about it, you know, I named the variable firstData. But I didn't want the data. I wanted the year. Maybe I had the error because I confused myself by calling it the first data. So I went in and changed the name of that variable.


So, where's Art? Now you know.

Sunday, May 8, 2016

Jorda, Schularick and Taylor: "In the age of credit, monetary aggregates come a distant second"


From the PDF recently mentioned by James Hamilton:
In the age of credit, monetary aggregates come a distant second when it comes to the association with macroeconomic variables. Real changes in M2 were more closely associated with cyclical fluctuations in real variables than credit before WW2. This is no longer true in the postwar era. As Table 10 demonstrates, today changes in real credit are generally much tighter aligned with real fluctuations than those of money.

From page 29 of the Macrofinancial History PDF, here is Table 10:


Real money growth in the U.S. shows 0.47 correlation with the growth rate of output before the Second World War, but only 0.24 -- half the correlation --  after the war.

Real credit growth in the U.S. shows 0.30 correlation with output growth before the Second World War, but shows 0.67 -- more than twice the correlation -- after the war.

This is a big deal.

The stuff we use for money has changed. That's why we're in the mess

Saturday, May 7, 2016

R



We'll see how that goes.

Friday, May 6, 2016

"Sterling soars"



A small tax on currency exchange would be a practical measure.

Thursday, May 5, 2016

Canary, in the hole


"Even more pointedly," Steve Keen writes,

unbeknownst to Hansen, a recovery had started just before he proposed the secular stagnation hypothesis

I love the irony. But why the recovery? For reasons that his supply-side theory did not contemplate, Keen says: A turnaround in the growth of credit.

I agree absolutely with Steve Keen on this. Absolutely. If credit was growing, the new money had to go somewhere. It went into the economy, and it created growth.

Hansen, quoted by Keen, said

Fundamental to an understanding of this problem are the changes in the "external" forces, if I may so describe them, which underlie economic progress—changes in the character of technological innovations, in the availability of new territory, and in the growth of population.

But those forces are inhibited if the money that lubricates them is insufficient. And the way we make money "sufficient", in this credit-based economy of ours, is by using credit. Think of credit growth as the canary in the coal mine. When credit dies, the economy dies.

Me, I have confidence in the entrepreneurial spirit; if credit is readily available, and if we've not got too much debt already, then I don't need to look at technology or territory or population. I can just look at the indicator -- credit growth. It tells me all I need to know.

Wednesday, May 4, 2016

I'll see your 'no recession' and raise you seven good years


One paragraph from Wells Fargo, February 2016:
Focusing on the next six months, our predictive model says there is a 12% probability of a recession occurring. For perspective, what the model is showing looks no worse than what was predicted from 1983 to 1988, or in the late 1990s. This justifies why we view the recent market corrections as being driven more by fear than reality. In 1984, there was a fear that inflation would rear its ugly head again, but it didn’t. The fear was real, but reality didn’t live up to the fears. We’re probably going through something similar now.

Interesting.

The source of the 12 percent chance? "Policy errors—like the Federal Reserve being too eager to hike interest rates".


Me, I don't have a predictor for recession. What I do have is an eye on credit use.

Note: The following graphs all show total credit to the private non-financial sector, from the Bank for International Settlements. Copyright, 2016, Bank for International Settlements (BIS).

Total credit to the private non-financial sector is going up again:
Graph #1
That's a sign of growth. Good growth for some years, because debt is below what we can bear.

Private credit use still has room to grow:
Graph #2
Still has room to grow, even if debt stays below the 10% growth rate.


Relative to Base, private credit use is starting to climb:
Graph #3
Couple thoughts on this one:

The ratio is low largely because of all the quantitative easing that took place. It's not like we paid off so much debt. Private sector deleveraging (as Steve Keen says) has been trivial.

However, the ratio is as low now as it was in 1955. This means our financial system is ready for another period of growth and inflation comparable to what we had between 1955 and 2007. Put that in your pipe and smoke it. Our financial system is ready for another period of growth and inflation comparable to what we had between 1955 and 2007.

We are much better now than we were in the 1950s at multiplying base money into credit money. So it need not take anywhere near 52 years to reach the next peak. If we expand base into credit rapidly, be prepared for some double-digit inflation. But hey, that would just reduce the burden of existing debt. Which was probably the point all along, come to think of it.

Remember, though, that turning base money into credit money generates more debt. We really do need policy to accelerate the repayment of private sector debt, in order to keep private debt from accumulating. It would fight inflation, too, that policy.


Relative to Federal debt, private debt is starting to climb:
Graph #4
That's a very good sign.

Right now, we're at about the same place on the curve that we were in 1995, when our economy was starting to give us good years. We'll get those again, the good years. But we have to prevent debt from going up as fast as it did in the late 1990s.

If only we had some kind of policy to accelerate the repayment of debt.


Last graph today. Just for you, because you think debt-to-income is important:
Graph #5
Right now, we're right on trend with the mid-1990s, where we were before debt got us into trouble. Right on trend. And the trend line goes up, so debt can go up and that will be okay. For a few years, anyhow.

If we get those accelerated repayment incentives in place, we can keep getting good growth while private debt goes down.


// Related post: An Arthurian Future

Tuesday, May 3, 2016

"Curve shifting??"


sk1

sk2

sk3

Monday, May 2, 2016

The trendline shows the shifting of the Phillips curve


My eyes popped right out my head when I saw George Lesica's graph of the Phillips curve. Here, take another look:

Source: https://lesica.com/exploring-the-phillips-curve.html
Copyright by George Lesica - Licensed CC BY-SA
Size reduced to fit my blog -- Click for larger image
The Phillips curve is no longer a meaningless cluster of dots. Lesica's graph shows "trade-off" curves in red and yellow and cyan and green and blue, all of them showing that inflation tends to be higher when unemployment is lower, and lower when unemployment is higher. That's what you're supposed to see in all those dots. Now, at last, I see it.


In the old PDF from 1958, where Bill Phillips introduced his curve to the world, he opened his remarks with these simple thoughts on supply and demand:
When the demand for a commodity or service is high relatively to the supply of it we expect the price to rise... Conversely when the demand is low relatively to the supply we expect the price to fall...

The supply and demand for labor works the same way, he said.


On the Phillips Curve graph, low unemployment is toward the left and high unemployment is toward the right. Low inflation is toward the bottom and high inflation is toward the top.

On the graph, "High inflation and low unemployment" is toward the upper-left. "Low inflation and high unemployment" is toward the lower-right. On the graph, a change from the the one state to the other produces a cluster of dots that is high on the left and low on the right. George Lesica's graph shows several of these clusters.


Time and time again I've seen people show a scatterplot with the dots all the same color. They put a straight-line trend on it, and point out that the trendline goes from low-on-the-left to high-on-the-right. That's not a Phillips curve, they say.

"As for inflation-unemployment “tradeoffs,” we should all be clear about what the data look like in practice..."
Source: Hussmann Funds

"If anything, [the trend line] suggests that higher unemployment and higher inflation in that very noisy data set go hand in hand."
Source: Illusion of Prosperity

"While playing with the data, a statistically significant relationship between inflation and employment growth emerges. 95 confidence interval on the slope returns (0.04, 0.22)."
Source: Synthenomics

"In English: there is no firm relationship here and the extremely weak relationship we do find runs in the opposite direction to what the Phillips Curve would predict."
Source: Fixing the Economists

"Indeed, if we do a reverse regression with the variable on the horizontal axis in the chart serving as the dependent variable, we can fit a long-run Phillips curve to the data, and that's the regression line in the chart."
Source: Stephen Williamson

"The Phillips curve is one of those 'regularities' that is more likely to exist in an economist mind than in reality."
Source: Naked Keynesianism

The trend line goes up-to-the-right, these people say, not down-to-the-right like the Phillips curve would. There is no Phillips curve, they say.

But the straight, upsloping trend line that these graphs show is not the Phillips curve. The trendline shows the shifting of the Phillips curve, not the shape of it.


Milton Friedman didn't say there's no Phillips curve. Friedman knew about supply and demand. He knew there is a tradeoff between inflation and unemployment.

What Friedman said was that the curve could shift to a different location, and we could end up with high inflation and high unemployment. High and high instead of high and low, he said.

He was right about that. When it happens, the scatterplot dots get more scattered on the graph. But if you have all the dots the same color, it doesn't look like different curves in different locations. It looks like there is no Phillips curve. But you can't really tell, because all the dots are the same color.


I wanted to duplicate George Lesica's graph. Duplicate it, because I never did manage to make a graph that shows the Phillips curve. Duplicate it, to learn how to make such a graph, and to make sure nobody's pulling my leg.

But there were things I didn't know. Was Lesica's data quarterly or monthly? I counted his blue dots and came up with way more than I should for quarterly data, so I went with monthly. Ended up with more than 800 rows of data in the spreadsheet. Would you guess there's 800 dots in the scatter above? I wouldn't.

And then, I didn't know how to handle the inflation rate, calculated (Lesica says) for the "subsequent 12 month period". It sounds simple. But when you have to work it out in a spreadsheet, there are many ways to do it. I was trying to duplicate one particular way without knowing which one. Here's what I did: From the first row of data I took the January 1948 unemployment rate, and paired it up with a calculation for inflation: the Jan 1949 CPI over the Jan 1948 CPI, minus 1, formatted as a percent. (The CPI numbers come as index values, so I had to calculate the inflation rate myself anyway.) Then I copied the calculation down the 800 rows.

Then I took my VBA code and modified it to generate the data subsets and make all the dots round and color them to match what George Lesica had done. Working out the colors was the hardest part. Here's how my graph came out:

Graph #2
I'm happy.

"Series1"  in the legend is Excel's original plot of the whole dataset. (I just left it there. Those dots are all hidden by the subset dots in various colors.)

My data (from FRED) runs from 1948 to March 2016. My scatterplot stops at March 2015 so that I can calculate the subsequent twelve months' inflation. George Lesica's graph stops in 2012. I have extra years. I made them brown, my dots after 2012. Coulda made them yellow, they fit right in with the yellow curve.

You'll want to compare the two graphs. "Note, for instance," George Lesica says, "the dark blue cluster in the upper right, they appear to form a curve that is convex to the origin, just as the theory says they should." I got the same dark blue cluster, forming the same curve.

If you go dot by dot, the two graphs still match up. Take the highest group, looks like five of those dark blue dots. The pattern of those five dots is almost identical on the two graphs. Below that group, a single dot (on both graphs) and to the right of it another group -- again with very similar arrangement on the two graphs. The slight variations could be due to data revisions or to different data sources (Did Lesica use the Consumer Price Index, or something else? I'm not sure) or to my choice of the calculation for the inflation rate.

But the slight variations don't concern me. I got curves, Phillips trade-off curves, identifiable by color. These curves correspond to those on the graph from George Lesica. Now I'm confident in his work and happy with mine, and I've finally managed to plot a Phillips curve that actually looks like a Phillips curve.

All in all, a good day.


// The Excel file.