Skip to content
Snippets Groups Projects
Verified Commit ccebd7d3 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

tuto_2_estim_simu.Rmd: fix few typo

parent 284632dc
No related merge requests found
Pipeline #1396 passed
...@@ -179,7 +179,7 @@ Use R functions to generate random values drawn from the Uniform and Gaussian di ...@@ -179,7 +179,7 @@ Use R functions to generate random values drawn from the Uniform and Gaussian di
**Hint:** **Hint:**
```{r eval=FALSE} ```{r eval=FALSE}
# Uniform U[1, 10] # Uniform U[0, 10]
obs <- runif(n = 100, min = 0, max = 10) obs <- runif(n = 100, min = 0, max = 10)
# Gaussian N(3, 4) # Gaussian N(3, 4)
obs <- rnorm(n = 100, mean = 3, sd = 4) obs <- rnorm(n = 100, mean = 3, sd = 4)
...@@ -201,7 +201,7 @@ mean(obs) ...@@ -201,7 +201,7 @@ mean(obs)
var(obs) var(obs)
``` ```
- Gaussian $\NN(3, 4)$: mean $= 3$ and variance $= 4$ - Gaussian $\NN(3, 4)$: mean $= 3$ and standard-deviation $= 4$
```{r} ```{r}
# random data # random data
...@@ -250,10 +250,10 @@ Because of the variability due to the randomness of the sampling. ...@@ -250,10 +250,10 @@ Because of the variability due to the randomness of the sampling.
<div class="pencadre"> <div class="pencadre">
We generate multiple random samples of size 100 following the same $\UU[1,10]$ uniform distribution and we compute the empirical mean for each sample. What do you see? We generate multiple random samples of size 100 following the same $\UU[0,10]$ uniform distribution and we compute the empirical mean for each sample. What do you see?
```{r} ```{r}
mean_estim <- replicate(1000, mean(runif(n = 100, min = 1, max = 10))) mean_estim <- replicate(1000, mean(runif(n = 100, min = 0, max = 10)))
hist(mean_estim) hist(mean_estim)
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment