7 Şubat 2013 Perşembe

Random Walks and Gambler's Ruin

To contact us Click HERE
Suppose you have $100 and you decide to go to a casino to try to double your money. Are you better off putting the whole $100 on a single bet, or should you make a lot of smaller bets? Maybe you should adjust the size of your bet as the evening progresses? Should you stop as soon as you reach $200 (if you ever do), or keep going?

Lots of people have opinions about questions like these. Today, I will show you how to calculate the correct answers yourself with just a few lines of code in R. Even better, you will understand the approach, which means you can do your own analysis of whatever strategy you want to test. And best of all, it's free: no need to spend real money at an actual casino to find out.

First, you need a copy of R. This is the free, high quality,open source statistical programming language that has become astandard for statisticians in industry and academia because it is botheasy and powerful. Download the latest version for Windows, Mac, orLinux from The R Project forStatistical Computing. Click on "Download R" and select a mirror(meaning, pick a site located close to you, to speed up the downloadprocess - there are mirrors all over the world), then click "DownloadR for Windows" (or Mac or Linux). Then just double click the installerand accept the default selections. You should now have a desktop iconor Start menu entry for starting R. You can copy and paste the samplecode from this blog post right into the R console window, and it willprint answers and draw graphs right on your computer screen.

We are going to answer the questions by running simulations. Not thegiant computer-game kind of simulations, with photo-realistic images ofblackjack tables, just a simple mathematical simulation of theessential elements of the process.

What do we need to know to set up the simulation? Not very much. Wedon't even need to know the details of any particular casino game,just your probability of winning and your payoff if you dowin. These vary depending on the game you choose to play.

So, let's assume the following situation:
  • You start with some initial amount of money.
  • You choose a size for your next bet.
  • With probability w, you win back your bet plus more.
  • With probability 1-w, you lose your bet.
  • You decide whether to play again or to stop.
  • You have to stop if you cannot make a minimum bet.
Let 'm' represent how much money you have to play with. Let 'b'represent the amount you choose to bet, which must be between 0 and'm'. Let 'w' be the probability of winning, and let 's' be themultiple of your bet that you get if you win. In symbols:
  • With probability 'w', you now have 'm+b*s', because you get back your bet, bringing your total back to 'm', but then on top of that you get 's*b' as a prize.
  • With probability '1-w', you now have 'm-b', because you lose the amount 'b' that you bet.

We can code this up using R without difficulty. We have only tospecify the strategy you want to test. We can encapsulate yourstrategy into a function that returns the size of your nextbet, as long as we interpret a zero or negative bet size as meaningyou choose to end the game and walk away without further betting.

However, the questions at the beginning of this article asked whetheryou would be "better off" under certain strategies. This is trickierto decide, since it depends on your personal values (both moral andfinancial). In other words, the answer depends on you.

In order to have something to discuss here, I will rank orderthe strategies according to the probability that you do not losemoney. However, you can choose to rank them by other criteria, ifyou want, such as the average amount of money you walk away with. Happily,the results of our simulation will provide a complete picture of thepossible outcomes, so you can decide for yourself which strategy youprefer.

Here's the code. You can copy and paste this into R now.

w <- 0.48s <- 1f <- 0.5nextBet <- function(m) {  if(m >= 200) 0  else m*f}oneNight <- function() {  m <- 100  b <- nextBet(m)  while(b >= 1 & m >= b) {    if(runif(1) < w) m <- m + b*s    else m <- m - b    b <- nextBet(m)  }  m}score <- function() {  n <- 1e4  x <- 0  for(i in 1:n)    if(oneNight() >= 100) x <- x+1  x/n}print(score())

This should only take a second or two to run, after which it shouldprint a number around 0.37, which means that in about 37% of the testcases, the strategy did allow you to leave with at least as much moneyas you started with. But what exactly is the strategy we are testinghere?

Let's examine the code. The first line sets the probability of winningto be 48%. That's because in R, the two characters '<' and '-'together act like an arrow pointing left, and they mean "assign".

The next line sets s=1, which means you are playingdouble-or-nothing.

Finally, the strategy: 'f' represents the fraction of your currentbalance that you will bet each turn. In this example, 'f' is 1/2,which means that on your first turn, you bet $50, which is half yourbalance. If you lose, you will only have $50 left, so your second betwill be half of that, or $25. If you win, you will have $150, so yoursecond bet will be $75. And so on.

How does 'f' come to mean 'fraction to bet'? The answer is in the'nextBet' function. This function receives as an input your currentmoney balance 'm'. If you have reached $200, it returns zero, meaningtime to go home. Otherwise, it returns 'm*f', which is fraction 'f' ofyour current balance.

You can modify the code to test other strategies by changing the'nextBet' function. We will look at an example toward the end. Firstthough, let's see how 'nextBet' gets used. The 'oneNight' functionstarts you off with m=100 dollars. Then it calculates your initialbet. As long as that bet is positive, it draws a random number betweenzero and one using 'runif(1)', and if that is less than 'w', youwin. Winning raises your balance to 'm+b*s', while losing lowers it to'm-b'. Finally, you get to decide the size of your next bet; choosingzero means you exit the loop and are done. I have imposed a minimum bet of$1 here, so actually, if your balance drops below $2, half of it willbe below $1, so you will stop. I have also insisted that you haveenough money to cover the bet (that's the 'm >= b' condition in thewhile loop).

Calling the 'oneNight' function simulates a single night at thecasino. However, any one night could be lucky or unlucky, purely bychance, irrespective of the strategy you want to test. So the 'score'function calls 'oneNight' ten thousand times, to give a very thoroughevaluation of the possible results.

You can modify the 'score' function to reflect whatever metric youwant to use for ranking strategies. I have made it count up the numberof nights in which you walk out with at least the $100 you startedwith, but you could instead ask it to compute the average dollaramount that you end up with each night, by writing something like

score <- function() {  n <- 1e4  x <- 0  for(i in 1:n)    x <- x + oneNight()  x/n}

If you copy and paste that in and run 'print(score())' again, R willprint a number around 89, meaning that on average you take home $89each night. In fact, in this specific example, you actually takehome either at least $200 (in 37% of the cases) or something close tozero (in 63% of the cases), which simply happen to average to $89:in no case do you ever take home an intermediate value like $89.

Notice that $89 is less than your initial $100 balance. Thisis bad: it means that on average, you lose $11 each night. The morenights you play this game, the more you lose. Yes, on any given night,you might win, and temporarily reverse the trend, but if you play manynights, you will find your money draining away, slowly and not quitesteadily, but inescapably.

If you like, you can even see a histogram or density plot showing thevariety of outcomes:

score <- function() {  n <- 1e4  x <- c()  for(i in 1:n)    x <- c(x,oneNight())  plot(density(x))  mean(x)}print(score())

Here's the result:

You see a large peak near zero (you never really go negative, that'sjust an artifact of the smoothing process inherent in drawing thecurve), and a smaller peak at and above $200. If you win the first twobets, you walk away with $225, but other combinations of wins andlosses can lead to a variety of other winning outcomes between $200and $300.

I've been saying you will get an answer "close" to $89, because eachtime you run the program, you will get different random numbers, andso get a slightly different final answer. That's why we simulate10,000 different nights: it helps average out the noise, so that youwind up with a pretty consistent analysis, regardless of the specificroll of the dice. If you want to always get the same answer each time,put 'set.seed(123)' at the start of the code instead.

Mathematicians call this sort of situation a "random walk", becauseyour balance staggers randomly up and down over time, and it has"absorbing barriers" at $2 and $200, because once you reach (or pass)those values, you stop. Here is a picture of one particular night,showing your balance over time:

In this example, you won the first bet, but then lost the nexttwo. Then you won again, but then you lost 5 times in a row, whichforced you to stop.

So far, so good (or bad). Whether you like the odds reflected in these pictures or not, they are the results of betting half your cash each time, in a double-or-nothing game with a 48% chance of winning, given that you stop if you double your initial cash. But the real question is, "compared to what?" We need to try some alternative strategies to see if they are better or worse.

We assume you cannot change 'w' and 's', because those arefixed characteristics of the game you are playing. In reality, youcould go look for a different, more favorable game, but 48%double-or-nothing is about as favorable as typical casino games get,actually.

So what can you change? You can change 'f', or you can modify the'nextBet' function to do something else, such as bet a fixed dollaramount each time, rather than a fixed percentage. This is easy enough:type in

f <- 25nextBet <- function(m) {  if(m >= 200) 0  else f}

and now 'f' is the fixed dollar amount of each bet, in this case $25each time.

So, try some experiments. Change 'f' to reflect different fractions ordifferent fixed size bets, and see what happens. Draw the densitycurves to see the whole story, or just pick the strategy with thehighest score. Let me know in the comment section if you find astrategy you think is really good - but be warned, ultimately, acasino exists to take your money, so stick with computer simulationsand stay out of actual casinos. One can in fact prove, mathematically,that in this sort of game there is NO "winning" strategy, meaning onethat returns on average more than your original $100. You can keepyour original $100 by not going to the casino at all, but the moreoften you bet, the more likely you are to lose.

To demonstrate that last remark, here are the results if you bet yourfull balance in one big bet: you get a 48% chance of walking away with$200, making this strategy "better" (by my scoring definition) thanthe first one we looked at, since that only gave you a 37% chance ofwinning. This raises your average payout to $96, still less than the$100 you started with (as I said, this is unavoidable), but betterthan the $89. Of course, you don't have as much "fun", since theevening is over after just one bet, either way. The distribution ofoutcomes is very sharply peaked, at zero and at $200, since these arethe only two possible outcomes.

Conversely, if you decide to make the evening last by making smallerbets, you wind up hurting your chances of winning: the more often youbet, the more likely it is that the casino takes your money, becausethe odds are in its favor. If we set 'f <- 0.1' in our originalcode, so that you bet only 10% of your balance each time, you win onlyabout 26% of nights, and your average balance is $61. The distribution ofoutcomes is also more skewed: more probability of losing everything,less of reaching, let alone exceeding, $200, as shown in the image atthe very beginning of this post.

Similarly, if we make a fixed size small bet, say $10 each time, weget a 30% chance of winning, and a $62 payout. Again, the results areworse financially than just betting your whole $100 in one shot,although they might provide more "entertainment value" since you getto keep playing longer.

Now it's your turn. Think up some new strategies you would like tocompare, code them up and see what you can discover! What happens,for instance, if you limit yourself to 20 bets rather than continuingto play indefinitely until you reach zero or $200? (Hint: modify the'oneNight' function to count the number of bets 'n', then add '& n<= 20' in the condition of the 'while' loop.) (Warning: nostrategy, no matter how clever, will prevent you from losing money atthis game, so don't try it with real money!)

If you liked this article, you may also like Supply, Demand and Market Microstructure for a more elaborate, "agent based" simulation of economic activity, or check out the Contents page for a complete list of past topics.

Please post questions, comments and other suggestions using the box below, or email me directly at the address given by the clues at the end of the Welcome post. Remember that you can sign up for email alerts about new posts by entering your address in the widget on the sidebar. If you prefer, you can follow @ingThruMath on Twitter, where I will tweet about each new post to this blog. The Contents page has a complete list of previous articles in historical order. Now that there are starting to be a lot of articles, you may also want to use the 'Topic', 'Search' or 'Archive' widgets in the side-bar to find other articles of related interest.

I hope you enjoyed this discussion. You can click the "M"button below to email this post to a friend, or the "t" button toTweet it, or the "f" button to share it on Facebook, and so on. Seeyou next time!

6 Şubat 2013 Çarşamba

The Dwindling Truth

To contact us Click HERE
Leave it to Paul Krugman to use his New York Times column to shade the truth. (The NYT's former public editor, Daniel Okrent, hardly a right-wing conservative, complained that Krugman's columns often had numerous factual errors. Why am I not surprised?)

In his latest column, Krugman promotes a number of false points and I will deal with some of them. Before looking at the substantive claims (the federal budget deficit has been "solved"), I'd like to begin with one his use of a deceitful term, "nonpartisan." He writes:
Recently the nonpartisan Center on Budget and Policy Priorities took Congressional Budget Office projections for the next decade and updated them to take account of two major deficit-reduction actions: the spending cuts agreed to in 2011, amounting to almost $1.5 trillion over the next decade; and the roughly $600 billion in tax increases on the affluent agreed to at the beginning of this year. What the center finds is a budget outlook that, as I said, isn’t great but isn’t terrible: It projects that the ratio of debt to G.D.P., the standard measure of America’s debt position, will be only modestly higher in 2022 than it is now.(Emphasis mine)
Sorry, Paul, but even your employer, the NYT, describes the CBPP as "left-leaning," the Times is not the only one to make that claim.Let's try Time, The Washington Post, and The National Journal, with none of them being considered "right-wing." What Krugman means by "nonpartisan" is that the CBPP does not officially endorse political candidates, but it clearly shills for Barack Obama and the Democrats in general.

For that matter, given Krugman's definition of "nonpartisan," he would have to claim the Heritage Foundation and Cato Institute are "nonpartisan," given that neither of them endorse actual candidates. Of course, one already knows what he thinks of those two organizations and considers them to be shills for the Republican Party. Yes, this is a small point, but once again we see how Krugman likes to play fast-and-loose with the truth.

On to the meat of the column itself. He writes:
Consider, for example, the case of Social Security. There was a case for paying down debt before the baby boomers began to retire, making it easier to pay full benefits later. But George W. Bush squandered the Clinton surplus on tax cuts and wars, and that window has closed. At this point, “reform” proposals are all about things like raising the retirement age or changing the inflation adjustment, moves that would gradually reduce benefits relative to current law. What problem is this supposed to solve?
 Assume that Al Gore had taken the office (and I am sure that Krugman would claim that he rightfully won it) and had left tax rates where they were. Would there have been deficits in the next few years? I suspect the "Clinton surplus" still would have disappeared for one important reason: the Tech Bubble popped in 2000 and a recession followed in 2001. Krugman writes: "It’s true that right now we have a large federal budget deficit. But that deficit is mainly the result of a depressed economy...." However, he wants us to assume that the reason we had deficits in 2001 and 2002 was that Congress lowered the top income tax rate from 39.6 percent to 35 percent...in 2003.

This is more of the "head I win, tails you lose" method that Krugman uses for his arguments. Now, I agree with him that Bush's wars cost this economy plenty (I don't believe that the economy will "benefit" from "weaponized Keynesianism" and spoke out against these wars from the beginning), but there also is another point that Krugman does not make: the source of larger tax revenues in the late 1990s versus the Housing Boom.

The Tech Bubble centered upon the stock markets and, not surprisingly, we saw a huge increase in the nominal amounts of taxes coming from capital gains during the second Clinton presidential term. In fact, at the end of 2000, capital gains receipts were $80 billion more than they were at the end of 1996. The following financial post also makes it clear that capital gains receipts fell sharply during the Bush years. (Capital gains rates were cut during the second Clinton term, yet they still rose, which surely must vex Keynesians, since they seem to believe such things are not possible.)
You'd better believe we pay careful attention to capital gains here. Friday, the Congressional Budget Office released an analysis of the rise and fall of federal individual income tax revenues from 1994 through 2004. It showed that capital gains accounted for half of the non-legislative changes to individual income tax revenues over the period. Ironically, capital gains revenues increased 0.7% of GDP from 1994 through 2000 under President Clinton, and they fell 0.6% of GDP from 2000 to 2004 under President Bush.
 They didn't fall because rates were cut; rather, they fell because people were not getting huge gains from "flipping" stocks after the Tech binge came to an end. Furthermore, a much different tax regime falls upon capital gains from the sale of houses, which means that the government was not able to cash in on the Fed's recycled dollars during the Housing Boom as it had done a decade earlier when the Clinton Bubble was on the rise.

Krugman, not surprisingly, leaves out that tidbit because it doesn't fit his narrative. Now, I will agree that deficit reduction should not be at the top of the agenda, but for different reasons than Krugman gives. He correctly points out that the depressed economy is responsible for much of the current deficit, although to him that is a good sign:
It’s true that right now we have a large federal budget deficit. But that deficit is mainly the result of a depressed economy — and you’re actually supposed to run deficits in a depressed economy to help support overall demand.
Unfortunately, throughout the piece Krugman trots out his "heads I win, tails you lose" logic. Government spending now is good; but cutting tax rates during a downturn is bad. (The economy was in recession shortly after Bush took office, and Democrats tried to claim that his talking about the recession and his campaign to cut tax rates was the cause of the recession.) The deficit is bad, but not so bad, and if the government inflates the currency, creates more jobs for bureaucrats and keeps entrepreneurs from starting new enterprises, and if the government continues to pay vast subsidies to politically-favored businesses (especially those in "green energy"), then out of that will come a real recovery.

I'm not sure how that will happen, but Krugman believes it will. Enough said.

The Big Shill

To contact us Click HERE
Readers of this blog know that I believe academic economists ought not to be shills for politicians and bureaucrats and let one's writings and pronouncements be infected with political partisanship. I have made that point many times and try to hold to it myself with everything that I write. (And that includes Ron Paul, even though I agree with him on many things. Nonetheless, academic economists should be willing to keep their distance, even from people they like.)

Second, academic economists ought to be able to differentiate between political "victories" by a politician and the economic outcomes. Unfortunately, Paul Krugman in this column manages to violate to principles and once again identifies himself as a shill, a lowly political operative.

It is no secret that Krugman worships Franklin Roosevelt and the New Deal, holding it to an almost mystical standard. That FDR's New Deal attempted to organize the entire U.S. economy into a series of cartels, destroyed agricultural products despite widespread hunger (the destruction financed by a tax on agricultural products), criminalized the kosher killing of chickens, and unleashed petty bureaucrats to burden entrepreneurs with useless rules is utterly irrelevant to Krugman. In fact, he wants us to believe that the New Deal -- which actually kept unemployment higher than it would have been had FDR just stuck to engaging in his adulterous liaisons -- in essence created an economic miracle: "...the New Deal had a revolutionary impact, empowering workers and creating a middle-class society that lasted for 40 years...."

In other words, Krugman wants us to believe that no U.S. "middle class" existed before the New Deal and that by empowering the state to move well beyond previous boundaries, FDR accomplished what no one ever before was able to do. Now, I have no idea how the New Deal could have done that, except that Krugman thinks that empowering labor unions and vastly expanding what truly is an unproductive bureaucracy managed to increase overall wealth in the U.S. economy.

This defies the imagination. The New Deal, from its inception, openly attempted to throw sand in the wheels of production and, thus, result in less wealth in the form of goods and services. Destruction of crops destroyed wealth; creating and maintaining cartels destroyed wealth. This is fundamental, yet Krugman turns the whole thing upside down by claiming that the use of violence (which enabled unions to gain higher wages for themselves -- at the expense of non-union workers) and the expansion of the bureaucracies, which are funded by taxpayers who are forced to give up some of their own wealth, somehow made all of us wealthier.

Krugman's gives himself away by telling readers that making some people poorer somehow is good for the economy. He writes:
That said, health reform will provide substantial aid to the bottom half of the income distribution, paid for largely through new taxes targeted on the top 1 percent, and the “fiscal cliff” deal further raises taxes on the affluent. Over all, 1-percenters will see their after-tax income fall around 6 percent; for the top tenth of a percent, the hit rises to around 9 percent. This will reverse only a fraction of the huge upward redistribution that has taken place since 1980, but it’s not trivial.
There is a huge problem here; Krugman explains that the new tax laws will make a portion of our population less well-off, but he does not adequately explain how that benefits the rest of us. Yes, ObamaCare allegedly will make it easier for some people to have access to health insurance, but ObamaCare itself, with all of its new rules, regulations, and criminal penalties, will result in less medical care overall being made available. Even Krugman admits that the health care law created a "Rube Goldberg device of regulations and subsidies...."

Is it my imagination, or is Barack Obama a magician? One would think that by adding rules and procedures (which, according to the Law of Opportunity Cost will increase overall costs), the government is going to force the medical care "supply curve" to the left (to use economists' jargon). How this is a "victory" for the economy, I have no idea.

In Krugman's view, making one group of people less-well-off is the same thing as making everyone else better off, yet he offers no mechanism other than pure transfer payments. However, transfer payments only distribute existing wealth and they create no new wealth. This is the classic "Zero-Sum Economy," and if that is Krugman's view of things, then how does he explain the fact that overall standards of living for everyone are substantially higher than they were during the New Deal. For that matter, they are substantially higher for everyone than they were during Ronald Reagan's presidency.

I would ask anyone to explain how Paul Krugman's theory of political economy actually demonstrates any causal relationship between New Deal and "Big Deal" policies and an overall rising standard of living. Krugman never has explained how an economy might grow in the first place, except to claim that inflation somehow creates economic miracles. (But even there, he does not explain a causal relationship between inflation and real economic growth.)

Furthermore, his explanation of "capital theory" really is nothing more than a spending theory. The new Apple iPhone, he surmised, might boost the economy because people will buy new ones. Come again? Does the iPhone do away with the Law of Opportunity Cost?

In the end, what Krugman is reduced to shilling for Barack Obama because he is a Democrat who has vastly expanded the reach of the State. And according to Krugman, an expanded and more powerful State through coercion makes us all richer. I'm not sure how that happens, but maybe Krugman will explain everything in a future column.

"Deficit Hawk Down," Financial Delusion Up

To contact us Click HERE
Yes, readers, I do agree with Paul Krugman when he says that the federal budget deficit is not the central fiscal issue that the U.S. Government and the U.S. economy face today. However (and you KNEW there would be a "however" coming), we disagree for opposing reasons.

In his latest column, Krugman attacks what he calls the "deficit hawks" (thus, the clever title for the column) who he says have always been wrong on the real effects of federal budget deficits:
Mr. Obama’s clearly deliberate neglect of Washington’s favorite obsession was just the latest sign that the self-styled deficit hawks — better described as deficit scolds — are losing their hold over political discourse. And that’s a very good thing. Why have the deficit scolds lost their grip? I’d suggest four interrelated reasons.
His reasons are as follows:
  • A true Greece-style meltdown has not happened; therefore, it cannot happen here;
  • Deficit spending as a share of GDP supposedly has started to decline, and the "deficit hawks" had predicted a reverse secular trend, i.e. recent deficits have become slightly smaller than previous years;
  • Advocates of government "austerity" are wrong because "austerity" did not immediately bring about full economic recovery where it was practiced;
  • The anti-deficit agenda really was a not-so-secret attempt by Evil Republicans to impose an unrelated evil political agenda.
 There is what I would call a "fifth reason" that Krugman says is a reason why the deficit hawks should not worry: the deficit is a good thing, not bad:
...it was, in fact, a good thing that the deficit was allowed to rise as the economy slumped. With private spending plunging as the housing bubble popped and cash-strapped families cut back, the willingness of the government to keep spending was one of the main reasons we didn’t experience a full replay of the Great Depression.

Whether or not one believes that the government's bank bailouts and subsequent "stimulus" spending prevented a return to 1933 is not answerable because one would have to prove a negative. What we are supposed to believe, however, is that "trickle-down" economics works when the government is in charge.

What happens? The government gives money or financial credits to politically-connected financial institutions and everyone pretends that the market values of the assets of those institutions are higher than what everyone understands is the case. (If you try to do this in private, the government will charge you with "fraud." However, if it is done by the government, it is called "saving the economy.")

Under outright stimulus, the government directly issues funds to politically-favored groups and the individuals then spend the money with the idea being that the good effects will "trickle down" to the rest of us who do not have the same political connections. Somehow, after we spend what money is left over, the effects will be such that the economy will magically have "traction" and it will move forth on its own.

Moreover, as Krugman argues, since the Fed has managed to push interest rates for U.S. securities to near-zero, then there is almost no opportunity cost for borrowing (and more borrowing). As he declared in a blog post a while back, it is "free money." Because the Fed and the Social Security Administration own the largest single blocs of U.S. debt, we "owe it to ourselves" which apparently means that there are no problems associated with the high debt of the U.S. Government.

What puts the USA in the "catbird's seat" (as opposed to other countries like Greece) is that this country has its own currency, which means that the government essentially can pay its bills with printed money, and since the U.S. Dollar effectively has been the "world currency" for a long time, we can get away with it, while countries like Zimbabwe could not. Unlike Greece, which is on the euro, we can print and devalue forever, and the rest of the world simply has to take it.

The federal deficit is not the problem in and of itself; instead, it is a symptom of a much larger fiscal problem, and that is that the U.S. Government is spending at rates that impose huge burdens on everyone else. In Krugman's Wonderland, government spending always is a net plus, especially when the economy is down.

(Yes, I know that Krugman calls for "austerity" during a boom, but in reality, politicians spend even more if they think the funds are available. Furthermore, I don't recall hearing Krugman call for massive cuts in government spending during the last few years of the Clinton Stock Bubble or during the Bush Housing Bubble.)

Furthermore, in Wonderland, those who are productive are the real "takers," entrepreneurs are irrelevant to a growing economy, the most desired industries are those that receive massive subsidies, and it is the people receiving direct government benefits that are most likely to take the entrepreneurial risks that our economy needs to grow. (Face it, that was the gist of Barack Obama's "Progressive" inauguration speech, and Krugman himself declared that there was "a lot for progressives to like" in that speech.

So, if the government spends enough money, if enough people can receive new benefits that they will spend quickly, if the spending "trickles down" to those not receiving the direct benefits, if the government continues to massively subsidize politically-favored "green energy" firms and "green" research, if the Fed continues to keep interest rates low, if the government continues to print money, if the "Inflation Fairy" does its magic, and if everyone just believes in the Greatness of Barack Obama, we someday will have real prosperity. That is the financial delusion that apparently rules in "elite" academic and political economics these days.

Krugman: The State Makes and Producers Take

To contact us Click HERE
Paul Krugman definitely is a class warfare sort of guy, but to him, the parasite classes are those that actually produce something, while people who simply consume are the real producers. There is no other way around his recent attacks.

Furthermore, Krugman at least has come into the open by insinuating strongly that the State owns everything, and anything that we keep is nothing more than a gift from the authorities. Now, even there, I will say that there is room for discussion, such as the question asking whether or not income taxes are more fair than sales taxes or value added taxes, but in the end, we still are at the same place: Krugman believes that the State is nothing less than an out-and-out god creator.

Krugman's latest column is more of the same. First, it has his normal partisan shilling, with an attempt to come up with an explanation as to why Republicans might disagree with The Great One. Second, he once again attacks entrepreneurs, assuming that those who actually create something in the economy are the real parasites, echoing Barack Obama's "You didn't build that" theme.

Before going further, however, let me say that the Republicans actually had a candidate who stood up for free markets, called for peace abroad, free trade, and sound money. The Republicans not only rejected him, but they also treated him about as badly as a party could do. While I registered a few years ago in Garrett County as a Republican, it was so I could vote for Ron Paul in the primaries, and sooner or later I will have to change my registration back to Independent.

My point is that the Republicans really have not done anything that warrants a coherent defense. If they ever decide to be a party that promotes liberty instead of a party promoting warfare abroad and police and prosecutorial abuse at home, then I might be interested in taking a look at them.

Nonetheless, the Republicans' slide into political oblivion is not my main concern. What does concern me, however, is that Progressives like Paul Krugman are winning in the government's all-out war against real-live entrepreneurs, people that Krugman simply attacks by calling them "rich."

We have to understand that there are three kinds of "rich" people in this country. The first group includes people who have inherited large sums of money, the "coupon clippers." For the most part, these people solidly vote Democrat. They sit on boards of foundations, arts councils and the like, and tend to be very liberal in their politics.

While they might not be happy about having to pay more taxes, they generally can afford the increases and by supporting tax hikes, they can receive free publicity for being "humanitarians" and "unselfish" citizens, people worthy of their great wealth. They became wealthy because they were born into wealth, but unlike their ancestors who had to save and invest, these noble people don't have to worry about getting their hands grubby in the marketplace.

The second group includes people like Warren Buffett, the "political entrepreneurs." These are people who tend to be politically-connected, and while they might actually have made large amounts of money through their own enterprise decisions, those decisions often are tied into decisions made by legislators or other government officials. A lot of former and current politicians such as Al Gore and John Kerry also are in this group.

Gore recently was listed at having a net worth of more than $100 million, and that was before he got the sweetheart deal to buy Apple stock at about $7 a share, about $493 below the price per share that mere mundanes have to pay. Although he was simply exercising a director's stock option, Gore became a director because of his political career, not because of any entrepreneurial talent. While he likes to tout himself as an entrepreneur, generally Gore has made money by being tied into government-protected "investments" in "green energy" firms, making speeches, and demanding that free speech be ended if it involves disagreeing with him on global warming.

For that matter, Paul Krugman tends to fall somewhat into this category, given the fact that his partisan writings have made him popular with certain groups of people. Like Gore, he has become a multimillionaire, although he has not had to take any risks in the process, unlike those real entrepreneurs Krugman loves to hate. Take away the partisan politics and Krugman is well-known in academic economic circles, but not elsewhere.

In his book, Throw Them All Out, Peter Schweizer documents how these politically-connected people make their money. One reviewer of Schweizer's book describes how Obama's "green energy" people distributed tax dollars:
Perhaps the most disturbing revelations come from Schweizer's investigation into the Obama Energy Department and its infamous "green energy" loan guarantee and grant programs, a program Schweizer calls "the greatest -- and most expensive -- example of crony capitalism in American history." The scandal surrounding Solyndra -- the now-bankrupt, Obama-connected solar power company that received a federally guaranteed loan of $573 million -- is well known. But Solyndra, Schweizer says, is only the tip of the iceberg.

According to his research, at least 10 members of President Obama's campaign finance committee and more than a dozen of his campaign bundlers were big winners in getting tax dollars from these programs. One chart in the book details how the 10 finance committee members collectively raised $457,834, and were in turn approved for grants or loans of nearly $11.4 billion -- quite a return on their investment.

In the loan-guarantee program alone, Schweizer writes, "$16.4 billion of the $20.5 billion in loans granted went to companies either run by or primarily owned by Obama financial backers -- individuals who were bundlers, members of Obama's National Finance Committee, or large donors to the Democratic Party." That is a staggering 71 percent of the loan money.

Schweizer cites example after example of companies that received grants or loans and documents their financial connections to the Obama campaign and the Democratic Party. And he shows how "the [Energy] department's loan and grant programs are run by partisans who were responsible for raising money during the Obama campaign from the same people who later came to seek government loans and grants."

These, of course, are the very kind of "rich" that Krugman praises. Their wealth heavily depends upon schmoozing politicians and is tied into governmental policies, and they tend to be politically liberal. That most of their "investment" actually weakens the economy is irrelevant. They have the correct political views and the correct political ties, so they are sacrosanct.

You won't see Al Gore or John Kerry arguing against higher tax rates, and why should they? For the most part, they either can shelter their income or pay the extra bit, knowing that they will receive huge amounts of free publicity for their "selfless" actions. Furthermore, their own investments will not be placed at risk by the new confiscatory tax policies.

Then there are the people Krugman hates, the real entrepreneurs, the people who have taken real risks and made their money in the markets without the political favors. Moreover, many are in the "millionaire next door" category, business owners who have saved (Oh, the HORROR! Predatory Savers in our midst!), invested, put off present consumption, and maybe don't have the proper educational "credentials."

Many of them tend to be conservative in their politics, many go to church (more "proof" that they are wicked parasites who don't even subscribe to correct thinking), and they are people whose investments are put at risk by government policies. In short, these are the people who have built the economy, people who have had vision and have worked hard.

Krugman considers people in this group to be utterly devoid of any decency at all. They don't think like him (some even believe in "Intelligent Design") and the way they handle their economic affairs truly gets on his nerves. Worst of all, they don't "consume" or "spend" enough of their incomes for Krugman's liking, and many of them don't even read the New York Times!

Perhaps the most telling quote is his claim that only Republicans live in intellectual bubbles:
Well, I don’t have a full answer, but I think it’s important to understand the extent to which leading Republicans live in an intellectual bubble. They get their news from Fox and other captive media, they get their policy analysis from billionaire-financed right-wing think tanks, and they’re often blissfully unaware both of contrary evidence and of how their positions sound to outsiders.

So when Mr. Romney made his infamous “47 percent” remarks, he wasn’t, in his own mind, saying anything outrageous or even controversial. He was just repeating a view that has become increasingly dominant inside the right-wing bubble, namely that a large and ever-growing proportion of Americans won’t take responsibility for their own lives and are mooching off the hard-working wealthy. Rising unemployment claims demonstrate laziness, not lack of jobs; rising disability claims represent malingering, not the real health problems of an aging work force.

This is rich coming from an Ivy League professor who is tied in with the NYT and Beltway Democrats. These are the people who believe that MSNBC is mainstream and "moderate," and anyone who does not hold their secular, urbanite views of the world really has no right even to exist.

I went to high school with a couple of people in the Sulzberger family (publisher of the NYT), and talk about people with limited viewpoints. They literally could not see anything outside of their circles and expressed utter contempt for anyone who did not share their views.

In a politicized world, people do tend to live in bubbles and their ability to think becomes limited. I remember a conversation with a Democratic Party activist in which I asked him (during the mid-1980s) why the economy of the U.S.S.R. was so backward compared to ours. He replied, "It is because the U.S.S.R. has not been a country as long as the United States." Yes, he really believed that.

Thus, I doubt seriously that Paul Krugman ever has ventured outside of his own cloistered surroundings to speak to real-live business owners who must make hard decisions when governments impose new minimum wages or jack up taxes. To Krugman, they are nothing more than parasitic whiners and he is not interested in even trying to understand another point of view. To him, these people are ignorant rubes and the sooner they are replaced with people on government payrolls or people receiving transfer payments, the better. After all, these people will spend their incomes which makes them the true economic benefactors.

Random Walks and Gambler's Ruin

To contact us Click HERE
Suppose you have $100 and you decide to go to a casino to try to double your money. Are you better off putting the whole $100 on a single bet, or should you make a lot of smaller bets? Maybe you should adjust the size of your bet as the evening progresses? Should you stop as soon as you reach $200 (if you ever do), or keep going?

Lots of people have opinions about questions like these. Today, I will show you how to calculate the correct answers yourself with just a few lines of code in R. Even better, you will understand the approach, which means you can do your own analysis of whatever strategy you want to test. And best of all, it's free: no need to spend real money at an actual casino to find out.

First, you need a copy of R. This is the free, high quality,open source statistical programming language that has become astandard for statisticians in industry and academia because it is botheasy and powerful. Download the latest version for Windows, Mac, orLinux from The R Project forStatistical Computing. Click on "Download R" and select a mirror(meaning, pick a site located close to you, to speed up the downloadprocess - there are mirrors all over the world), then click "DownloadR for Windows" (or Mac or Linux). Then just double click the installerand accept the default selections. You should now have a desktop iconor Start menu entry for starting R. You can copy and paste the samplecode from this blog post right into the R console window, and it willprint answers and draw graphs right on your computer screen.

We are going to answer the questions by running simulations. Not thegiant computer-game kind of simulations, with photo-realistic images ofblackjack tables, just a simple mathematical simulation of theessential elements of the process.

What do we need to know to set up the simulation? Not very much. Wedon't even need to know the details of any particular casino game,just your probability of winning and your payoff if you dowin. These vary depending on the game you choose to play.

So, let's assume the following situation:
  • You start with some initial amount of money.
  • You choose a size for your next bet.
  • With probability w, you win back your bet plus more.
  • With probability 1-w, you lose your bet.
  • You decide whether to play again or to stop.
  • You have to stop if you cannot make a minimum bet.
Let 'm' represent how much money you have to play with. Let 'b'represent the amount you choose to bet, which must be between 0 and'm'. Let 'w' be the probability of winning, and let 's' be themultiple of your bet that you get if you win. In symbols:
  • With probability 'w', you now have 'm+b*s', because you get back your bet, bringing your total back to 'm', but then on top of that you get 's*b' as a prize.
  • With probability '1-w', you now have 'm-b', because you lose the amount 'b' that you bet.

We can code this up using R without difficulty. We have only tospecify the strategy you want to test. We can encapsulate yourstrategy into a function that returns the size of your nextbet, as long as we interpret a zero or negative bet size as meaningyou choose to end the game and walk away without further betting.

However, the questions at the beginning of this article asked whetheryou would be "better off" under certain strategies. This is trickierto decide, since it depends on your personal values (both moral andfinancial). In other words, the answer depends on you.

In order to have something to discuss here, I will rank orderthe strategies according to the probability that you do not losemoney. However, you can choose to rank them by other criteria, ifyou want, such as the average amount of money you walk away with. Happily,the results of our simulation will provide a complete picture of thepossible outcomes, so you can decide for yourself which strategy youprefer.

Here's the code. You can copy and paste this into R now.

w <- 0.48s <- 1f <- 0.5nextBet <- function(m) {  if(m >= 200) 0  else m*f}oneNight <- function() {  m <- 100  b <- nextBet(m)  while(b >= 1 & m >= b) {    if(runif(1) < w) m <- m + b*s    else m <- m - b    b <- nextBet(m)  }  m}score <- function() {  n <- 1e4  x <- 0  for(i in 1:n)    if(oneNight() >= 100) x <- x+1  x/n}print(score())

This should only take a second or two to run, after which it shouldprint a number around 0.37, which means that in about 37% of the testcases, the strategy did allow you to leave with at least as much moneyas you started with. But what exactly is the strategy we are testinghere?

Let's examine the code. The first line sets the probability of winningto be 48%. That's because in R, the two characters '<' and '-'together act like an arrow pointing left, and they mean "assign".

The next line sets s=1, which means you are playingdouble-or-nothing.

Finally, the strategy: 'f' represents the fraction of your currentbalance that you will bet each turn. In this example, 'f' is 1/2,which means that on your first turn, you bet $50, which is half yourbalance. If you lose, you will only have $50 left, so your second betwill be half of that, or $25. If you win, you will have $150, so yoursecond bet will be $75. And so on.

How does 'f' come to mean 'fraction to bet'? The answer is in the'nextBet' function. This function receives as an input your currentmoney balance 'm'. If you have reached $200, it returns zero, meaningtime to go home. Otherwise, it returns 'm*f', which is fraction 'f' ofyour current balance.

You can modify the code to test other strategies by changing the'nextBet' function. We will look at an example toward the end. Firstthough, let's see how 'nextBet' gets used. The 'oneNight' functionstarts you off with m=100 dollars. Then it calculates your initialbet. As long as that bet is positive, it draws a random number betweenzero and one using 'runif(1)', and if that is less than 'w', youwin. Winning raises your balance to 'm+b*s', while losing lowers it to'm-b'. Finally, you get to decide the size of your next bet; choosingzero means you exit the loop and are done. I have imposed a minimum bet of$1 here, so actually, if your balance drops below $2, half of it willbe below $1, so you will stop. I have also insisted that you haveenough money to cover the bet (that's the 'm >= b' condition in thewhile loop).

Calling the 'oneNight' function simulates a single night at thecasino. However, any one night could be lucky or unlucky, purely bychance, irrespective of the strategy you want to test. So the 'score'function calls 'oneNight' ten thousand times, to give a very thoroughevaluation of the possible results.

You can modify the 'score' function to reflect whatever metric youwant to use for ranking strategies. I have made it count up the numberof nights in which you walk out with at least the $100 you startedwith, but you could instead ask it to compute the average dollaramount that you end up with each night, by writing something like

score <- function() {  n <- 1e4  x <- 0  for(i in 1:n)    x <- x + oneNight()  x/n}

If you copy and paste that in and run 'print(score())' again, R willprint a number around 89, meaning that on average you take home $89each night. In fact, in this specific example, you actually takehome either at least $200 (in 37% of the cases) or something close tozero (in 63% of the cases), which simply happen to average to $89:in no case do you ever take home an intermediate value like $89.

Notice that $89 is less than your initial $100 balance. Thisis bad: it means that on average, you lose $11 each night. The morenights you play this game, the more you lose. Yes, on any given night,you might win, and temporarily reverse the trend, but if you play manynights, you will find your money draining away, slowly and not quitesteadily, but inescapably.

If you like, you can even see a histogram or density plot showing thevariety of outcomes:

score <- function() {  n <- 1e4  x <- c()  for(i in 1:n)    x <- c(x,oneNight())  plot(density(x))  mean(x)}print(score())

Here's the result:

You see a large peak near zero (you never really go negative, that'sjust an artifact of the smoothing process inherent in drawing thecurve), and a smaller peak at and above $200. If you win the first twobets, you walk away with $225, but other combinations of wins andlosses can lead to a variety of other winning outcomes between $200and $300.

I've been saying you will get an answer "close" to $89, because eachtime you run the program, you will get different random numbers, andso get a slightly different final answer. That's why we simulate10,000 different nights: it helps average out the noise, so that youwind up with a pretty consistent analysis, regardless of the specificroll of the dice. If you want to always get the same answer each time,put 'set.seed(123)' at the start of the code instead.

Mathematicians call this sort of situation a "random walk", becauseyour balance staggers randomly up and down over time, and it has"absorbing barriers" at $2 and $200, because once you reach (or pass)those values, you stop. Here is a picture of one particular night,showing your balance over time:

In this example, you won the first bet, but then lost the nexttwo. Then you won again, but then you lost 5 times in a row, whichforced you to stop.

So far, so good (or bad). Whether you like the odds reflected in these pictures or not, they are the results of betting half your cash each time, in a double-or-nothing game with a 48% chance of winning, given that you stop if you double your initial cash. But the real question is, "compared to what?" We need to try some alternative strategies to see if they are better or worse.

We assume you cannot change 'w' and 's', because those arefixed characteristics of the game you are playing. In reality, youcould go look for a different, more favorable game, but 48%double-or-nothing is about as favorable as typical casino games get,actually.

So what can you change? You can change 'f', or you can modify the'nextBet' function to do something else, such as bet a fixed dollaramount each time, rather than a fixed percentage. This is easy enough:type in

f <- 25nextBet <- function(m) {  if(m >= 200) 0  else f}

and now 'f' is the fixed dollar amount of each bet, in this case $25each time.

So, try some experiments. Change 'f' to reflect different fractions ordifferent fixed size bets, and see what happens. Draw the densitycurves to see the whole story, or just pick the strategy with thehighest score. Let me know in the comment section if you find astrategy you think is really good - but be warned, ultimately, acasino exists to take your money, so stick with computer simulationsand stay out of actual casinos. One can in fact prove, mathematically,that in this sort of game there is NO "winning" strategy, meaning onethat returns on average more than your original $100. You can keepyour original $100 by not going to the casino at all, but the moreoften you bet, the more likely you are to lose.

To demonstrate that last remark, here are the results if you bet yourfull balance in one big bet: you get a 48% chance of walking away with$200, making this strategy "better" (by my scoring definition) thanthe first one we looked at, since that only gave you a 37% chance ofwinning. This raises your average payout to $96, still less than the$100 you started with (as I said, this is unavoidable), but betterthan the $89. Of course, you don't have as much "fun", since theevening is over after just one bet, either way. The distribution ofoutcomes is very sharply peaked, at zero and at $200, since these arethe only two possible outcomes.

Conversely, if you decide to make the evening last by making smallerbets, you wind up hurting your chances of winning: the more often youbet, the more likely it is that the casino takes your money, becausethe odds are in its favor. If we set 'f <- 0.1' in our originalcode, so that you bet only 10% of your balance each time, you win onlyabout 26% of nights, and your average balance is $61. The distribution ofoutcomes is also more skewed: more probability of losing everything,less of reaching, let alone exceeding, $200, as shown in the image atthe very beginning of this post.

Similarly, if we make a fixed size small bet, say $10 each time, weget a 30% chance of winning, and a $62 payout. Again, the results areworse financially than just betting your whole $100 in one shot,although they might provide more "entertainment value" since you getto keep playing longer.

Now it's your turn. Think up some new strategies you would like tocompare, code them up and see what you can discover! What happens,for instance, if you limit yourself to 20 bets rather than continuingto play indefinitely until you reach zero or $200? (Hint: modify the'oneNight' function to count the number of bets 'n', then add '& n<= 20' in the condition of the 'while' loop.) (Warning: nostrategy, no matter how clever, will prevent you from losing money atthis game, so don't try it with real money!)

If you liked this article, you may also like Supply, Demand and Market Microstructure for a more elaborate, "agent based" simulation of economic activity, or check out the Contents page for a complete list of past topics.

Please post questions, comments and other suggestions using the box below, or email me directly at the address given by the clues at the end of the Welcome post. Remember that you can sign up for email alerts about new posts by entering your address in the widget on the sidebar. If you prefer, you can follow @ingThruMath on Twitter, where I will tweet about each new post to this blog. The Contents page has a complete list of previous articles in historical order. Now that there are starting to be a lot of articles, you may also want to use the 'Topic', 'Search' or 'Archive' widgets in the side-bar to find other articles of related interest.

I hope you enjoyed this discussion. You can click the "M"button below to email this post to a friend, or the "t" button toTweet it, or the "f" button to share it on Facebook, and so on. Seeyou next time!

5 Şubat 2013 Salı

Is the Fed Hampering the Recovery?

To contact us Click HERE
In his blog post on "Calvinist Monetary Economics," Paul Krugman claims that a recent Wall Street Journal op-ed by John Taylor on why he believes the Fed is hampering the recovery by keeping interest rates low falls into the "Calvinball" category. Writes Krugman:
For those who don’t read the classics, Calvinball is a sport in which you change the rules whenever you feel like it, very much including in the middle of games.

Back then the tight-money types were inventing new and peculiar principles of monetary policy on the fly; it was obvious that they were looking for some reason, any reason, to justify a rise in rates, because, well, because.
Krugman goes on:
Now Taylor is doing the same thing. He claims that he can show that the Fed’s low-rate policy is actually contractionary, using “basic microeconomic analysis”. Actually, as Miles Kimball points out, he’s committing a basic microeconomic fallacy — a fallacy you usually identify with Econ 101 freshmen early in the semester (and as it happens the same fallacy committed by Rajan).

For Taylor argues that low rates engineered by the Fed are just like a price ceiling that reduces the supply of loans, and therefore reduces overall lending.

Wow. No, the Fed’s interest rate target isn’t a price control; there is no legal or other restraint on the rates lenders can charge. The Fed is driving down interest rates, or equivalently driving up the price of bonds, by buying bonds; I can’t think of any kind of economic analysis in which that would reduce the quantity of bonds sellers end up issuing, that is, the amount of borrowing (and lending) in the economy.
 I'll put all of this controversy in the simplest of terms: Keynesian orthodoxy claims that lower interest rates will always have a positive effect upon the economy because the low rates encourage more borrowing, ceteris paribus, even in a so-called liquidity trap. The issue of the "liquidity trap," according to Keynesians, is that other factors are holding back "aggregate demand" so that lowering rates by themselves cannot create enough aggregate demand to lift the economy out of a downturn.

That is where fiscal policy comes in, and that is what Krugman has been saying. Thus, anyone who might claim that attempts by the Fed to push down interest rates might have an opposite effect of what is intended is playing "Calvinball."

The Keynesian approach is pretty straightforward, maybe even crude. All economic activity of an economy, all of the relative prices, all of the relations of production, the products creates, everything, can be put into two functions, aggregate demand and aggregate supply. Push aggregate demand to the right, and as long as the AS curve in not in its steep region, economic growth will occur without too much inflation.

Should the economy be in a "liquidity trap," then the only way to get the AD curve to move to the right is for government to engage in lots and lots of spending. The positive results from the spending then will trickle down to everyone else, provided government spends "enough." However, as Bob Murphy has noted, it seems that Krugman is playing some "Calvinball" of his own:
Here is my observation: Paul Krugman will say that government spending has surged under Obama (and Bernanke has engaged in monetary stimulus) when he wants to blow up right-wingers for their failed predictions, yet referring to the same period of time he will say that government spending has actually been either normal or even contractionary, when explaining why his Keynesian solutions haven’t fixed the economy.
 Certainly, Krugman is not above using the "Heads I win, tails you lose," method of arguing. However, I'd like to address a larger question: Can the Fed's "expansionary policies" actually have a contractionary effect upon the economy?

I'd like to take a different approach than has Taylor and point out that the Fed's purchases of securities of all types -- government, mortgage securities, private assets -- is done in order to keep the asset prices high and send false signals to the markets that these securities are worth more than they really are. (The only word for it is fraud and I should point out that when someone in private business, as opposed to Ben Bernanke, tries to artificially jack up the price of securities, he is likely to be prosecuted.)

The Fed wants to drive money toward those assets by keeping their prices artificially high, and I would argue this has two problems that do hamper the economy:
  • First, it prevents the needed liquidation of those assets which cannot be supported by market activity so that investors and entrepreneurs can follow real price signals to see where lines of sustainable investments are located. By throwing in what essentially are false prices, the Fed is making it harder for entrepreneurs to find the suitable production lines;
  • Second, the Fed's policies discourage savings (which makes Keynesians very happy, given their vaunted "multiplier" is 1 over the savings rate, so the less we save, the greater the "multiplier"), as real savings provide the liquid capital for long-term investments.

Given Krugman's mechanistic views of the economy and his overt hostility toward economic activity that is not created by government fiat, I doubt what I have said would convince Keynesians of anything. To them, the economy is a simple thing controlled by levers of spending with the Really Smart People in Washington and at Princeton knowing at all times when to "step on the gas" and "when to apply the brakes."

Nonetheless, I also would argue that the Fed is holding back the recovery, even as it acts in the name of "aggregate demand." This isn't "Calvinball." It is economics.