Assignment 5 Solution 2013

3 what happens to your function if the mean and sd

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ated values. The final one shows this very convincingly. 3. What happens to your function if the mean and sd input vectors are vectors of length n? Is your function still correct? If so, use your function to generate values of y for which √ y = 3x + 2 + xε where x takes 1001 equally spaced values in the interval [0, 1], and ε is standard normal. The above function will give correct results when the mean and sd parameters are vectors of length n. They do not need to be constant vectors. > x <- seq(0,1,length=1001) > y <- rnormBM(1001, mean=3*x+2, sd=sqrt(x)) 4. Produce a scatter plot of the simulated x and y data produced in the previous question. > plot(y ~ x) q q q q qq q q q q qq q q q qq q q q q q q q qq q q qqq q q q qq qq q q q q q qq q qq qq q qqqq q q q q qq q q q q q qq q q q q qq q q q qq qq q q q q q qq q q q qq q q q q q qq q q qq q q qq q qq q q q q q qq q qq qq q q q qq q qq q q q q qq q q q q q q q q q q qqqq q q qqq q q q q qqq q qq q q q qq q q qqq q q q qq q q qq qq q q qqq q qqq q q qq q q q q q qq qq q qq q q qq q qq qq q q qq qqq q q q q q q q q qqq q qq q qq q qqq q q q q qq q q qq q qq q q q q qq q q q qq q q qq q q q q q q q q q qq q qqq q q qq q qq q q qq qq q q q q q qq q q q q q q q qqq qq q q q q q q qq q qqq q qq q qq qq q q qq q qq q q q qq q qq q q qq q qq qqq q qqq q qqq q q q q qq qq q q q q q q q q qq q q q qqqqqq q q q q q q q q qq q q q q q q q q q qq q q q q q qq q qq q q qq q q q qq q q q qq q q qq q qq qq q q q q qq qqq q qq q q q qq q qq q q q q q qq q qqq q qq q q q q q qq q q q qqqq qq qq q q qq q q q qq q qqq q q q qq q q q q q q q q q qq qq q qq q qq qq q q q q q qq q q q q qq q q q qq qq q qq q q q qq qq q q q qq q q qq q q qq q q q q q qqq q qq qq q qq qqq q q q qq q qq q q q q q q qq q q q q q q qq qq q q qq q q qqq q q qq q qq q qqq q q qq q q qq q q qq q qq q q q qq q qq q qq qq q q q q q q qq q q qq qq qq q q qq q q qq q qq qqqq q qqq qqqq qq q q qq q q qqqq q q q qq qqq q q q qq qq qqq q q q qq q q q q q q q qqqq q qq qq qq q q q qqqqqqqq qqq qqqq q q q qqqq q q q qq qq qqqq q q qq q q qq q qqqqqqq q q qq q qqq qqqqq qq qq q qq q qq q q q qq qq q qq q q qqqqqq qqq q q q q q qqq q qqqq qqq qqqq qqq q q q q qq q q q qq q q q q qq q q q q qqq q q q q q qq q q q qq qq q q q q q qq q q 4 3 2 y 5 6 q q q qq q q q q 0.0 0.2 0.4 0.6 x 0.8 1.0...
View Full Document

Ask a homework question - tutors are online