asadoughi / stat-learning

Notes and exercise attempts for "An Introduction to Statistical Learning"
http://asadoughi.github.io/stat-learning
2.12k stars 1.62k forks source link

Chapter 3: Exercise 13 #39

Closed asadoughi closed 9 years ago

asadoughi commented 9 years ago

As reported by @shayan-mj in #3

In the exercise 13 of chapter 3 was said "create vector, esp, from a N(0, 0.25) distribution i.e. a normal distribution with mean zero and variance 0.25". So, the standard deviation is equal to 0.5, and in solution was written "esp = rnorm(100, 0, 0.25)", but in it should be written "esp = rnorm(100, 0, 0.5)", because "rnorm" function get standard deviation as its argument.

asadoughi commented 9 years ago

Thanks, @shayan-mj, for pointing this out. I verified that rnorm() does take standard deviation as its argument so instead of 0.25, the argument should be sqrt(0.25) = 0.5. I will fix this promptly.