Skip to content

Commit 8fcacdd

Browse files
author
Bob Jansen
committed
Inline code whitespace fixes
1 parent b9c4c0d commit 8fcacdd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Chapter2_MorePyMC/MorePyMC.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
"\n",
149149
"Initializing a stochastic variable requires a `name` argument, plus additional parameters that are class specific. For example:\n",
150150
"\n",
151-
"`some_variable = mc.DiscreteUniform( \"discrete_uni_var\", 0, 4 )`\n",
151+
"`some_variable = mc.DiscreteUniform(\"discrete_uni_var\", 0, 4)`\n",
152152
"\n",
153153
"where 0,4 are the `DiscreteUniform`-specific upper and lower bound on the random variable. The [PyMC docs](http://pymc-devs.github.com/pymc/distributions.html) contain the specific parameters for stochastic variables. (Or use `??` if you are using IPython!)\n",
154154
"\n",
@@ -158,13 +158,13 @@
158158
"\n",
159159
"The `size` argument also solves the annoying case where you may have many variables $\\beta_i, \\; i = 1,...,N$ you wish to model. Instead of creating arbitrary names and variables for each one, like:\n",
160160
"\n",
161-
" beta_1 = mc.Uniform( \"beta_1\", 0, 1)\n",
162-
" beta_2 = mc.Uniform( \"beta_2\", 0, 1)\n",
161+
" beta_1 = mc.Uniform(\"beta_1\", 0, 1)\n",
162+
" beta_2 = mc.Uniform(\"beta_2\", 0, 1)\n",
163163
" ...\n",
164164
"\n",
165165
"we can instead wrap them into a single variable:\n",
166166
"\n",
167-
" betas = mc.Uniform( \"betas\", 0, 1, size = N )\n",
167+
" betas = mc.Uniform(\"betas\", 0, 1, size=N)\n",
168168
"\n",
169169
"#### Calling `random()`\n",
170170
"We can also call on a stochastic variable's `random()` method, which (given the parent values) will generate a new, random value. Below we demonstrate this using the texting example from the previous chapter."
@@ -320,7 +320,7 @@
320320
"Inside the deterministic decorator, the `Stochastic` variables passed in behave like scalars or Numpy arrays ( if multivariable), and *not* like `Stochastic` variables. For example, running the following:\n",
321321
"\n",
322322
" @mc.deterministic\n",
323-
" def some_deterministic( stoch = some_stochastic_var ):\n",
323+
" def some_deterministic(stoch=some_stochastic_var):\n",
324324
" return stoch.value**2\n",
325325
"\n",
326326
"\n",

0 commit comments

Comments
 (0)