Skip to content

Commit

Permalink
full update 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviergimenez committed Oct 17, 2024
1 parent 422c512 commit 8262fc7
Show file tree
Hide file tree
Showing 89 changed files with 7,379 additions and 7,365 deletions.
12 changes: 12 additions & 0 deletions docs/practicals/libs/header-attrs-2.28/header-attrs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
4 changes: 2 additions & 2 deletions docs/practicals/practical1.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Practical 1</title>
<meta charset="utf-8" />
<meta name="author" content="Olivier Gimenez" />
<script src="libs/header-attrs-2.22/header-attrs.js"></script>
<script src="libs/header-attrs-2.28/header-attrs.js"></script>
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link rel="stylesheet" href="slides-theme.css" type="text/css" />
</head>
Expand All @@ -19,7 +19,7 @@
### Olivier Gimenez
]
.date[
### last updated: 2023-11-11
### last updated: 2024-10-17
]

---
Expand Down
10 changes: 5 additions & 5 deletions docs/practicals/practical2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Practical 2</title>
<meta charset="utf-8" />
<meta name="author" content="Olivier Gimenez" />
<script src="libs/header-attrs-2.22/header-attrs.js"></script>
<script src="libs/header-attrs-2.28/header-attrs.js"></script>
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link rel="stylesheet" href="slides-theme.css" type="text/css" />
</head>
Expand All @@ -19,7 +19,7 @@
### Olivier Gimenez
]
.date[
### last updated: 2023-11-11
### last updated: 2024-10-17
]

---
Expand All @@ -31,7 +31,7 @@

* Assume we have collected data on the height of 100 people:

```r
``` r
# set seed for random numbers
set.seed(2020)
# simulate data from Normal distribution
Expand Down Expand Up @@ -59,7 +59,7 @@

Function for likelihood of normal distribution w/ mean `\(\mu\)` and standard deviation `\(\sigma\)`:

```r
``` r
negloglik &lt;- function(theta, data) {
mu &lt;- theta[1]
sigma &lt;- theta[2]
Expand All @@ -77,7 +77,7 @@

* Minimiiiiiize

```r
``` r
fit &lt;- optim(par = c(1,1), fn = negloglik, data = height)
fit
```
Expand Down
428 changes: 213 additions & 215 deletions docs/practicals/practical2_files/figure-html/unnamed-chunk-2-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
460 changes: 229 additions & 231 deletions docs/practicals/practical2_files/figure-html/unnamed-chunk-5-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions docs/practicals/practical3.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Practical 3</title>
<meta charset="utf-8" />
<meta name="author" content="Olivier Gimenez" />
<script src="libs/header-attrs-2.22/header-attrs.js"></script>
<script src="libs/header-attrs-2.28/header-attrs.js"></script>
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link rel="stylesheet" href="slides-theme.css" type="text/css" />
</head>
Expand All @@ -19,7 +19,7 @@
### Olivier Gimenez
]
.date[
### last updated: 2023-11-11
### last updated: 2024-10-17
]

---
Expand Down Expand Up @@ -48,15 +48,15 @@

.small-font[

```r
``` r
(alpha &lt;- ( (1 - 0.57)/(0.073*0.073) - (1/0.57) )*0.57^2)
```

```
## [1] 25.64636
```

```r
``` r
(beta &lt;- alpha * ( (1/0.57) - 1))
```

Expand All @@ -78,28 +78,28 @@
# Solution


```r
``` r
alpha &lt;- ( (1 - 0.57)/(0.073*0.073) - (1/0.57) )*0.57^2
beta &lt;- alpha * ( (1/0.57) - 1)
n &lt;- 10000
samp &lt;- rbeta(n, alpha, beta)
```


```r
``` r
(mu &lt;- mean(samp))
```

```
## [1] 0.5699368
## [1] 0.5716494
```

```r
``` r
(sigma &lt;- sqrt(var(samp)))
```

```
## [1] 0.07231072
## [1] 0.07286554
```

</textarea>
Expand Down
12 changes: 6 additions & 6 deletions docs/practicals/practical4.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Practical 4</title>
<meta charset="utf-8" />
<meta name="author" content="Olivier Gimenez" />
<script src="libs/header-attrs-2.22/header-attrs.js"></script>
<script src="libs/header-attrs-2.28/header-attrs.js"></script>
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link rel="stylesheet" href="slides-theme.css" type="text/css" />
</head>
Expand All @@ -19,7 +19,7 @@
### Olivier Gimenez
]
.date[
### last updated: 2023-11-11
### last updated: 2024-10-17
]

---
Expand All @@ -45,7 +45,7 @@

.center[

```r
``` r
plot(density(rnorm(1000, 0, 1000)), main="", xlab="Height (m)")
```

Expand All @@ -59,7 +59,7 @@

.center[

```r
``` r
plot(density(rnorm(1000, 2, 0.5)), main="", xlab="Height (m)")
```

Expand All @@ -73,7 +73,7 @@

.center[

```r
``` r
plot(density(plogis(rnorm(1000,0,10)), from = 0, to = 1), main = '', xlab = 'survival')
```

Expand All @@ -87,7 +87,7 @@

.center[

```r
``` r
plot(density(plogis(rnorm(1000,0,1.5)), from = 0, to = 1), main = '', xlab = 'survival')
```

Expand Down
355 changes: 184 additions & 171 deletions docs/practicals/practical4_files/figure-html/unnamed-chunk-1-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
327 changes: 154 additions & 173 deletions docs/practicals/practical4_files/figure-html/unnamed-chunk-2-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
318 changes: 158 additions & 160 deletions docs/practicals/practical4_files/figure-html/unnamed-chunk-3-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
355 changes: 179 additions & 176 deletions docs/practicals/practical4_files/figure-html/unnamed-chunk-4-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/practicals/practical5.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Practical 5</title>
<meta charset="utf-8" />
<meta name="author" content="Olivier Gimenez" />
<script src="libs/header-attrs-2.22/header-attrs.js"></script>
<script src="libs/header-attrs-2.28/header-attrs.js"></script>
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link rel="stylesheet" href="slides-theme.css" type="text/css" />
</head>
Expand All @@ -19,7 +19,7 @@
### Olivier Gimenez
]
.date[
### last updated: 2023-11-11
### last updated: 2024-10-17
]

---
Expand Down
Loading

0 comments on commit 8262fc7

Please sign in to comment.