Question

Generate random sample size 100 from the distribution with density f(x) = 2 exp(−2x), x ≥...

Generate random sample size 100 from the distribution with density f(x) = 2 exp(−2x), x ≥ 0. Check the feasibility of the obtained data using: histogram, mean, variance, EDF.

Homework Answers

Answer #1

R code:

y=runif(100,0,1)
x=-0.5*log(1-y)
hist(x,breaks=5)
mean(x)
var(x)
z=ecdf(x)
plot(z, xlab = 'Sample Quantiles of x', ylab = '', main = 'Empirical Cumluative Distribution of x')
mtext(text = expression(hat(F)[n](x)), side = 2, line = 2.5)
Out put:

> mean(x)
[1] 0.4322894
> var(x)
[1] 0.1811383

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Give an algorithm to generate random variates from the following probability density function. f(x) = 2x/3...
Give an algorithm to generate random variates from the following probability density function. f(x) = 2x/3 if 0<=x<=1 =1-x/3 if 1<=x<=3
Use R to code a function to generate a random sample of size n from the...
Use R to code a function to generate a random sample of size n from the Beta(a, b) distribution by the acceptance-rejection method. (1) Generate a random sample of size 3000 from the Beta(4,3) distribution. (2) Graph the histogram of the sample with the theoretical Beta(4,3) density superimposed. Answer the above questions by showing the R codes and results.
3. Suppose that a random variable X has the density function f (x) = 2x, 0...
3. Suppose that a random variable X has the density function f (x) = 2x, 0 ≤ x ≤ 1, and that f (x) = 0 for x <0 and x > 1. a) Calculate the distribution function for X, as well as the corresponding E (X) and variance V (X). b) The numbers ​​u1 = 0.0503, u2 = 0.9149, u3 = 0.3103, u4 = 0.1866, u5 = 0.6553 uniformly distributed, independent random numbers on the interval [0, 1]. Calculate,...
Find the sampling distribution of R for a random sample of size 2 from a continuous...
Find the sampling distribution of R for a random sample of size 2 from a continuous distribution with a function of the shape f(x)= 2x if 0 R=yn-y1
Suppose a random sample of size n was drawn from a distribution with pdf f(y,a)=(1/a )...
Suppose a random sample of size n was drawn from a distribution with pdf f(y,a)=(1/a ) exp(-y/a) where y is between y>0 and a>0. Write down the central limit theorem for the standardized sample mean in terms of a and find a formula for a 95% confidence interval ..(hint: this is the exponential distribution with mean a)
Develop an algorithm for generation a random sample of size N from a binomial random variable...
Develop an algorithm for generation a random sample of size N from a binomial random variable X with the parameter n, p. [Hint: X can be represented as the number of successes in n independent Bernoulli trials. Each success having probability p, and X = Si=1nXi , where Pr(Xi = 1) = p, and Pr(Xi = 0) = 1 – p.] (a) Generate a sample of size 32 from X ~ Binomial (n = 7, p = 0.2) (b) Compute...
Let the probability density function of the random variable X be f(x) = { e ^2x...
Let the probability density function of the random variable X be f(x) = { e ^2x if x ≤ 0 ;1 /x ^2 if x ≥ 2 ; 0 otherwise} Find the cumulative distribution function (cdf) of X.
Let X¯ be the sample mean of a random sample X1, . . . , Xn...
Let X¯ be the sample mean of a random sample X1, . . . , Xn from the exponential distribution, Exp(θ), with density function f(x) = (1/θ) exp{−x/θ}, x > 0. Show that X¯ is an unbiased point estimator of θ.
USING MATLAB (A) Use the rand command to generate “X” of size [10000 1] and the...
USING MATLAB (A) Use the rand command to generate “X” of size [10000 1] and the command histogram to plot the probability distribution of “X” along with axis labels and a title that includes the mean and variance for “X”. (B) Use a while loop and the rand command to generate “X1”, also of size [10000 1] but with each element of “X1” being the mean of 2 “samples” generated using rand, i.e. a “sample size” of 2 separate numbers...
Let X1,X2,...,X50 denote a random sample of size 50 from the distribution whose probability density function...
Let X1,X2,...,X50 denote a random sample of size 50 from the distribution whose probability density function is given by f(x) =(5e−5x, if x ≥ 0 0, otherwise If Y = X1 + X2 + ... + X50, then approximate the P(Y ≥ 12.5).
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT