Skip to content

Commit 8cfe7ab

Browse files
some formatting issues
1 parent cc2ab1a commit 8cfe7ab

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

Chapter1_Introduction/Chapter1_Introduction.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"metadata": {},
4747
"source": [
4848
"\n",
49-
"###The Bayesian state of mind\n",
49+
"### The Bayesian state of mind\n",
5050
"\n",
5151
"\n",
5252
"Bayesian inference differs from more traditional statistical inference by preserving *uncertainty*. At first, this sounds like a bad statistical technique. Isn't statistics all about deriving *certainty* from randomness? To reconcile this, we need to start thinking like Bayesians. \n",
@@ -89,7 +89,7 @@
8989
"metadata": {},
9090
"source": [
9191
"\n",
92-
"###Bayesian Inference in Practice\n",
92+
"### Bayesian Inference in Practice\n",
9393
"\n",
9494
" If frequentist and Bayesian inference were programming functions, with inputs being statistical problems, then the two would be different in what they return to the user. The frequentist inference function would return a number, representing an estimate (typically a summary statistic like the sample average etc.), whereas the Bayesian function would return *probabilities*.\n",
9595
"\n",
@@ -246,7 +246,7 @@
246246
"cell_type": "markdown",
247247
"metadata": {},
248248
"source": [
249-
"#####Example: Bug, or just sweet, unintended feature?\n",
249+
"##### Example: Bug, or just sweet, unintended feature?\n",
250250
"\n",
251251
"\n",
252252
"Let $A$ denote the event that our code has **no bugs** in it. Let $X$ denote the event that the code passes all debugging tests. For now, we will leave the prior probability of no bugs as a variable, i.e. $P(A) = p$. \n",
@@ -1027,4 +1027,4 @@
10271027
"metadata": {}
10281028
}
10291029
]
1030-
}
1030+
}

Chapter2_MorePyMC/MorePyMC.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@
15731573
"metadata": {},
15741574
"source": [
15751575
"\n",
1576-
"#####Example: Challenger Space Shuttle Disaster <span id=\"challenger\"/>\n",
1576+
"##### Example: Challenger Space Shuttle Disaster <span id=\"challenger\"/>\n",
15771577
"\n",
15781578
"On January 28, 1986, the twenty-fifth flight of the U.S. space shuttle program ended in disaster when one of the rocket boosters of the Shuttle Challenger exploded shortly after lift-off, killing all seven crew members. The presidential commission on the accident concluded that it was caused by the failure of an O-ring in a field joint on the rocket booster, and that this failure was due to a faulty design that made the O-ring unacceptably sensitive to a number of factors including outside temperature. Of the previous 24 flights, data were available on failures of O-rings on 23, (one was lost at sea), and these data were discussed on the evening preceding the Challenger launch, but unfortunately only the data corresponding to the 7 flights on which there was a damage incident were considered important and these were thought to show no obvious trend. The data are shown below (see [1]):\n",
15791579
"\n",
@@ -2593,4 +2593,4 @@
25932593
"metadata": {}
25942594
}
25952595
]
2596-
}
2596+
}

Chapter3_MCMC/IntroMCMC.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
"In the above algorithm's pseudocode, notice that only the current position matters (new positions are investigated only near the current position). We can describe this property as *memorylessness*, i.e. the algorithm does not care *how* it arrived at its current position, only that it is there. \n",
317317
"\n",
318318
"### Other approximation solutions to the posterior\n",
319-
"Besides MCMC, there are other procedures available for determining the posterior distributions. A [Laplace approximation](http://en.wikipedia.org/wiki/Laplace's_method) is an approximation of the posterior using simple functions. A more advanced method is [Variational Bayes](http://en.wikipedia.org/wiki/Variational_Bayesian_methods). All three methods, Laplace Approximations, Variational Bayes, and classical MCMC have their pros and cons. We will only focus on MCMC in this book. That being said, my friend Imri Sofar likes to classify MCMC algorithms as either \"they suck\", or \"they really suck\". He classifies the particular flavour of MCMC used by PyMC as just *sucks* ;)"
319+
"Besides MCMC, there are other procedures available for determining the posterior distributions. A Laplace approximation is an approximation of the posterior using simple functions. A more advanced method is [Variational Bayes](http://en.wikipedia.org/wiki/Variational_Bayesian_methods). All three methods, Laplace Approximations, Variational Bayes, and classical MCMC have their pros and cons. We will only focus on MCMC in this book. That being said, my friend Imri Sofar likes to classify MCMC algorithms as either \"they suck\", or \"they really suck\". He classifies the particular flavour of MCMC used by PyMC as just *sucks* ;)"
320320
]
321321
},
322322
{
@@ -1338,4 +1338,4 @@
13381338
"metadata": {}
13391339
}
13401340
]
1341-
}
1341+
}

Chapter5_LossFunctions/LossFunctions.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"cell_type": "markdown",
3434
"metadata": {},
3535
"source": [
36-
"### Loss Functions\n",
36+
"## Loss Functions\n",
3737
"\n",
3838
"We introduce what statisticians and decision theorists call *loss functions*. A loss function is a function of the true parameter, and an estimate of that parameter\n",
3939
"\n",
@@ -126,7 +126,6 @@
126126
"cell_type": "markdown",
127127
"metadata": {},
128128
"source": [
129-
"\n",
130129
"##### Example: Optimizing for the *Showcase* on *The Price is Right*\n",
131130
"\n",
132131
"Bless you if you are ever chosen as a contestant on the Price is Right, for here we will show you how to optimize your final price on the *Showcase*. For those who forget the rules:\n",
@@ -389,7 +388,6 @@
389388
"cell_type": "markdown",
390389
"metadata": {},
391390
"source": [
392-
"\n",
393391
"### Minimizing our losses\n",
394392
"\n",
395393
"It would be wise to choose the estimate that minimizes our expected loss. This corresponds to the minimum point on each of the curves above. More formally, we would like to minimize our expected loss by finding the solution to\n",
@@ -524,7 +522,7 @@
524522
"\n",
525523
"Maybe it is clear now why the first-introduced loss functions are used most often in the mathematics of Bayesian inference: no complicated optimizations are necessary. Luckily, we have machines to do the complications for us. \n",
526524
"\n",
527-
"### Machine Learning via Bayesian Methods\n",
525+
"## Machine Learning via Bayesian Methods\n",
528526
"\n",
529527
"Whereas frequentist methods strive to achieve the best precision about all possible parameters, machine learning cares to achieve the best *prediction* among all possible parameters. Of course, one way to achieve accurate predictions is to aim for accurate predictions, but often your prediction measure and what frequentist methods are optimizing for are very different. \n",
530528
"\n",
@@ -548,7 +546,7 @@
548546
"\n",
549547
"Suppose the future return of a stock price is very small, say 0.01 (or 1%). We have a model that predicts the stock's future price, and our profit and loss is directly tied to us acting on the prediction. How should we measure the loss associated with the model's predictions, and subsequent future predictions? A squared-error loss is agnostic to the signage and would penalize a prediction of -0.01 equally as bad a prediction of 0.03:\n",
550548
"\n",
551-
"$$ \\(0.01 - (-0.01) \\)^2 = (0.01 - 0.03)^2 = 0.004$$\n",
549+
"$$ (0.01 - (-0.01))^2 = (0.01 - 0.03)^2 = 0.004$$\n",
552550
"\n",
553551
"If you had made a bet based on your model's prediction, you would have earned money with a prediction of 0.03, and lost money with a prediction of -0.01, yet our loss did not capture this. We need a better loss that takes into account the *sign* of the prediction and true value. We design a new loss that is better for financial applications below:"
554552
]

0 commit comments

Comments
 (0)