I am trying to solve this problem in R. Would appreciate any hints or helps. A r
ID: 3126563 • Letter: I
Question
I am trying to solve this problem in R. Would appreciate any hints or helps.
A random variable Y has a log normal distribution, i.e log(Y) has a standard normal distribution. Do the following:
a) Fenerate a random sample of 750 points (assign xy).
b) Find mean(xy) and sd(xy).
c) A point of xy is said to be extreme when it’s more than 2.5 times the SD units away from mean. (Notice that the theoretical mean of y is exp(1/2) and the theoretical standard deviation of y is sqrt(exp(2)-exp(1))). Now, extract extreme points from xy (assign ab) and all non-extreme points (assign abc).
Explanation / Answer
a) Use
to generate 750 sample points with
number of observations. If length(n) > 1, the length is taken to be the number required.
mean and standard deviation of the distribution on the log scale with default values of 0 and 1 respectively.
b) mean(a)
gives the mean of the points
sd(a)
gives the standard deviation
> mean(xy)
[1] 1.646524
>
> sd(xy)
[1] 2.19058
m=mean(xy)
sd = sd(xy)
c)
ab = xy[which(xy>m+2.5*sd | xy < m-2.5*sd)]
abc = xy[which(xy<= m+2.5*sd & xy >= m-2.5*sd)]
This extracts extreme points to ab and non-extreme points to abc
nnumber of observations. If length(n) > 1, the length is taken to be the number required.
meanlog, sdlogmean and standard deviation of the distribution on the log scale with default values of 0 and 1 respectively.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.