Lab Assignment 01
PSTAT 174/274 September 27, 2021
1. Let X ∼ U(−1,1) be uniform on (-1, 1), i.e., fX(x) = 1/2 when −1 < x < 1 and zero otherwise. Let Y = X2. Calculate the correlation of X and Y ? Now, use runif() in R to generate 1000 I.I.D samples of X’s from U(−1,1), and Y’s, calculate the sample correlation of X and Y . Are X and Y uncorrelated? Are X and Y independent? Any conclusion on the relationship between uncorrelated and independent?
2. Use runif() in R to generate 10, 100, and 1000 I.I.D samples from U(−1,1) respectively, calculate the sample means, compare these sample means with true mean? Any conclusion on the relationship between sample mean and true mean?
Copyright By PowCoder代写 加微信 powcoder
3. Generate 1000 I.I.D samples of size 100 from U(−1,1), and calculate the sample means. Now, we have 1000 sample means. Plot the histogram of these sample means. What’s the asymptotic distribution of these sample means?
4. The file uspop.txt contains US population from 1970 t0 1990. Plot US population (in Millions) vs Year. Now, take the sqaure root of US population (in Millions), and plot it vs Year. Any difference between these two graphs?
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com