Skip to content

Commit

Permalink
more monkeying with unit 9 files
Browse files Browse the repository at this point in the history
  • Loading branch information
paciorek committed Oct 26, 2023
1 parent d0aaf4f commit d3bee90
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions _freeze/units/unit10-linalg/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/units/unit10-linalg/execute-results/tex.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/units/unit9-sim/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/units/unit9-sim/execute-results/tex.json

Large diffs are not rendered by default.

Binary file modified _freeze/units/unit9-sim/figure-html/unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/units/unit9-sim/figure-html/unnamed-chunk-4-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/units/unit9-sim/figure-pdf/unnamed-chunk-2-1.pdf
Binary file not shown.
Binary file modified _freeze/units/unit9-sim/figure-pdf/unnamed-chunk-4-3.pdf
Binary file not shown.
7 changes: 1 addition & 6 deletions units/unit10-linalg.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ execute:
from: markdown+tex_math_single_backslash
---

```{r, fake-setup, echo=FALSE}
## For some reason we need an R chunk in the doc or get result seen in `error.log`.
z <- 1
```


[PDF](./unit10-linalg.pdf){.btn .btn-primary}

Expand Down Expand Up @@ -448,7 +443,7 @@ the variance attributable to the basis vectors determined by the
eigenvalues.

To go the other direction, we can project a vector $y$ onto the space
spanned by the eigenvectors: $z = (\Gamma^{\top}\Gamma)^{-1}\Gamma^{\top}y = \Gamma^{\top}y$,
spanned by the eigenvectors: $w = (\Gamma^{\top}\Gamma)^{-1}\Gamma^{\top}y = \Gamma^{\top}y = \Lambda^{1/2}z$,
where the simplification of course comes from $\Gamma$ being orthogonal.

If $x^{\top}Ax\geq0$ then $A$ is nonnegative definite (also called
Expand Down
11 changes: 6 additions & 5 deletions units/unit9-sim.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ Some examples of simulation variances we might be interested in in the
regression example include:

- Uncertainty in our estimate of bias:
$\widehat{\mbox{Var}}(\widehat{E(\hat{\beta})}-\beta)$.
$\widehat{\mbox{Var}}(\hat{E}(\hat{\beta})-\beta)$.

- Uncertainty in the estimated variance of the estimated coefficient:
$\widehat{\mbox{Var}}(\widehat{\mbox{Var}(\hat{\beta})})$.
$\widehat{\mbox{Var}}(\widehat{\mbox{Var}}(\hat{\beta}))$.

- Uncertainty in the estimated mean square prediction error:
$\widehat{\mbox{Var}}(\widehat{\mbox{MSPE}(Y^{*})})$.
$\widehat{\mbox{Var}}(\widehat{\mbox{MSPE}}(Y^{*}))$.

In all cases we have to estimate the simulation variance, hence the
$\widehat{\mbox{Var}}()$ notation.
Expand Down Expand Up @@ -660,7 +660,7 @@ The output of the PCG-64 is 64 bits while for the Mersenne Twister the output is
The result is that the generators generate fewer unique values than their periods.
This means you could get duplicated values in long runs, but this does not violate the
comment about the periodicity of PCG-64 and Mersenne-Twister being longer than $2^{64}$ and $2^{32}$.
Why not? Bbecause the two values after the two
Why not? Because the two values after the two
duplicated numbers will not be duplicates of each other -- as noted previously, there is
a distinction between the output presented to the user and the state of
the RNG algorithm.
Expand Down Expand Up @@ -737,7 +737,7 @@ rng = np.random.Generator(np.random.PCG64(seed = 1)) # PCG-64
but below note that there is a simpler way to change to the PCG-64.

Then to use that generator when doing operations that generate random numbers, we need
to use methods accessed via the generator:
to use methods accessed via the `Generator` object (`rng` here):

```{python}
#| eval: false
Expand Down Expand Up @@ -816,6 +816,7 @@ saved_state['state']['inc'] # increment ('c')

`saved_state` contains the actual state and the value of `c`, the increment.

Question: how many bits does `saved_state['state']['state']` correspond to?

## RNG in parallel

Expand Down

0 comments on commit d3bee90

Please sign in to comment.