Skip to content

Commit

Permalink
Merge pull request #93 from gtbook/frank/sept19
Browse files Browse the repository at this point in the history
Auto-index
  • Loading branch information
dellaert authored Sep 20, 2024
2 parents 8787b03 + 365fc63 commit c745d99
Show file tree
Hide file tree
Showing 39 changed files with 502 additions and 136 deletions.
2 changes: 2 additions & 0 deletions S13_math.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{index}graphical models\n",
"```\n",
"**Graphical models** are useful to represent, manipulate, and compute with all of the above. Besides sampling, another way to model complex probability distributions is by using a graph framework called *Bayes networks*, which we will recognize as an excellent tool for *modeling* uncertainty in both sensing *and* acting. For inference, on the other hand, we introduce the use of *factor graphs*, which are more convenient and compact to describe relative probabilities when sensor measurements are available and can be conditioned upon."
]
},
Expand Down
14 changes: 11 additions & 3 deletions S21_sorter_state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@
}
},
"source": [
"The starting point for reasoning with uncertainty is to define the set of **outcomes** that might occur.\n",
"This set of all possible outcomes is called the **sample space**, often denoted by $\\Omega.$\n",
"```{index}sample space",
"```",
"The starting point for reasoning with uncertainty is to define the set of outcomes that might occur.\n",
"The set of all possible outcomes is called the **sample space**, often denoted by $\\Omega.$\n",
"In our example, when an item of trash arrives on the conveyor belt,\n",
"there are five possible outcomes,\n",
"\n",
Expand All @@ -187,8 +189,10 @@
}
},
"source": [
"```{index}event, probability distribution",
"```",
"## Probability Distributions\n",
"Subsets of $\\Omega$ are called **events**. A **probability distribution**, $P$, assigns a probability $0 \\leq P(A) \\leq 1$ to each event $A \\subseteq \\Omega$, with $P(\\emptyset) = 0$ and $P(\\Omega)=1$. \n",
"A subset of the sample space $\\Omega$ is called an **event**. A **probability distribution**, $P$, assigns a probability $0 \\leq P(A) \\leq 1$ to each event $A \\subseteq \\Omega$, with $P(\\emptyset) = 0$ and $P(\\Omega)=1$. \n",
"In addition, for disjoint events, $A_i \\cap A_j = \\emptyset$, we have\n",
"$P(A_i \\cup A_j) = P(A_i) + P(A_j)$.\n",
"Using this property, it is a simple matter to compute the probability for any $A \\subseteq \\Omega$\n",
Expand Down Expand Up @@ -281,6 +285,8 @@
}
},
"source": [
"```{index}prior",
"```",
"We call this type of probabilistic knowledge about the state of the world, in the absence of any other information, a **prior**, because it represents our belief *before* any evidence (e.g., sensor data) has been acquired.\n",
"\n",
"\n",
Expand Down Expand Up @@ -932,6 +938,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{index}decision tree",
"```",
"As you can see, this is a PMF on the variable with id $42$, and it indeed has probabilities (that add up to one) for values `0..2`. Internally, GTSAM *actually* represents a PMF as a small **decision tree**, which you can reveal using `show`:"
]
},
Expand Down
17 changes: 16 additions & 1 deletion S22_sorter_actions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{index}random variable\n",
"```\n",
"\n",
"In probability theory, a **random variable** is defined as a mapping from the sample space\n",
"to real numbers, $X : \\Omega \\rightarrow \\mathbb{R}$.\n",
"We typically use upper case letters to denote random variables, and we typically\n",
Expand All @@ -320,9 +323,15 @@
"This is exactly what we did above, when we used the probability distribution on\n",
"categories to infer the distribution on costs.\n",
"\n",
"```{index}random variable; discrete random variable\n",
"```\n",
"\n",
"```{index}pair: probability mass function; PMF\n",
"```\n",
"\n",
"A **discrete random variable** is defined as a random variable that takes values \n",
"from a finite (or even countably infinite) set. The probability distribution\n",
"for a discrete random variable is called a **probability mass function (PMF)**.\n",
"for a discrete random variable is called a **probability mass function** or **PMF**.\n",
"The pmf for random variable $X$ is typically denoted by $p_X$ or simply by $p$\n",
"when the context makes clear the random variable under consideration. Discrete random variables\n",
"and pmf's are key concepts in the development of probability theory,\n",
Expand Down Expand Up @@ -356,6 +365,8 @@
"id": "wTjUvyLVcb7v"
},
"source": [
"```{index}expectation, expected value\n",
"```\n",
"## Expectation\n",
"\n",
"For many robotics applications, we hope that the robot will operate for a long period of time.\n",
Expand Down Expand Up @@ -532,6 +543,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{index}Probability theory\n",
"```\n",
"## Probability Theory vs. Statistics\n",
"\n",
"> Probability theory is the study of certain mathematical functions, while statistics are functions of data. The two are related, but different.\n",
Expand Down Expand Up @@ -571,6 +584,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{index}statistic, weak law of large numbers\n",
"```\n",
"A **statistic** is any function of data (including the identity function). \n",
"Consider a set of measurements $\\{ z_1, \\dots z_N \\}$.\n",
"The average of these values, often denoted by $\\bar{z}$, is a statistic, and it can be computed as\n",
Expand Down
14 changes: 12 additions & 2 deletions S23_sorter_sensing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
}
},
"source": [
"```{index}conditional probability\n",
"```\n",
"## Binary Sensors\n",
"\n",
"> A binary sensor can be modeled using conditional probability distributions.\n",
Expand All @@ -158,7 +160,7 @@
"A straightforward approach is to merely perform a set of experiments, and construct\n",
"a histogram of the results.\n",
"\n",
"Because the probability of the outcome depends on the type of the trash item, we represent this with a **Conditional Probability**, which accords a value \n",
"Because the probability of the outcome depends on the type of the trash item, we represent this with a **conditional probability**, which accords a value \n",
"\n",
"$$P(conductive| trash~category)$$\n",
"\n",
Expand All @@ -177,6 +179,8 @@
}
},
"source": [
"```{index}pair: conditional probability table; CPT\n",
"```\n",
"## Conditional Probabilities\n",
"\n",
"In general, the probability mass function of *any* single variable $X$ can be\n",
Expand All @@ -190,7 +194,7 @@
"$Y$, this is just a probability distribution over $X$, with parameters given by a\n",
"PMF, as before. \n",
"\n",
"There are many ways to specify conditional probabilities, but in this simple case, with a binary outcome and a finite number of discrete categories, the simplest representation is to use a a **Conditional Probability Table** or CPT. "
"There are many ways to specify conditional probabilities, but in this simple case, with a binary outcome and a finite number of discrete categories, the simplest representation is to use a a **conditional probability table** or **CPT**. "
]
},
{
Expand Down Expand Up @@ -250,6 +254,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{index}sensor model\n",
"```\n",
"Conditional probability distributions are a great way to represent\n",
"knowledge about the world in robotics. In particular, we use them\n",
"to model sensors in this chapter.\n",
Expand Down Expand Up @@ -409,6 +415,8 @@
"id": "X14X0FzuTJcT"
},
"source": [
"```{index}density\n",
"```\n",
"Note that for any given continuous value, the probability is zero: we can only use the Gaussian as a *density*, integrating over a small (or large) continuous interval to obtain the probability of the value landing within that interval.\n",
"\n",
"We denote a conditional **density** with a lowercase $p$ to indicate it is a density over a continuous quantity. The condition to the right of the bar is still a discrete category:\n",
Expand Down Expand Up @@ -498,6 +506,8 @@
"id": "r7RbXHzOTJcT"
},
"source": [
"```{index}inverse transform sampling\n",
"```\n",
"## Simulation by Sampling\n",
"\n",
"> Simulation can be implemented by sampling from both state and measurement.\n",
Expand Down
Loading

0 comments on commit c745d99

Please sign in to comment.