Question

Use R. Generate a random sample with n=15 random observations from an exponential distribution with mean=1....

Use R.

Generate a random sample with n=15 random observations from an exponential distribution with mean=1.

  • Calculate the sample median, which is an estimator of the population median.
  • Use bootstrap (nonparametric, with B=1000) methods to estimate the variance of the estimator for the population median.
  • use the Monte Carlo method, e.g. generate 1000 samples of size 15 to estimate the true variance of the median estimator. Compare and comment on your results.

Homework Answers

Answer #1

> n=15
> b=1000
> s=rexp(n,1);s #sample of size n=15 from exponential with mean=1
[1] 0.407867708 0.223045019 0.571697697 0.516058067 1.433474415 0.005044012 0.292488087
[8] 1.265140870 0.561035751 2.060778400 1.044908378 0.274859678 0.376427082 0.130451812
[15] 0.048147370
> sample_median=median(s);sample_median
[1] 0.4078677
> #bootsrap
> med=c()
> for(i in 1:b)
+ {
+ s=sample(s,n)
+ med[i]=median(s)
+ }
> var(med) #bootsrap estimate of variance of estimate of population median
[1] 0
>
> ##monte carlo
> med1=c()
> for(i in 1:1000)
+ {
+ s=rexp(15,1)
+ med1[i]=median(s)
+ }
> var(med1)
[1] 0.06725635

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
Use R statistical software to answer the following: Let X1, ..., X6 be a random sample...
Use R statistical software to answer the following: Let X1, ..., X6 be a random sample of size n = 6 from the distribution with pdf f(x) = x / 8 , 0 < x < 4 and 0 otherwise. (a) Use Monte Carlo to calculate Var(Xbar), and knowing that Var(Xbar) = sigma^2 / n, what is the true value of Var(Xbar)? ## use runif() to generate samples
a. If ? ̅1 is the mean of a random sample of size n from a...
a. If ? ̅1 is the mean of a random sample of size n from a normal population with mean ? and variance ?1 2 and ? ̅2 is the mean of a random sample of size n from a normal population with mean ? and variance ?2 2, and the two samples are independent, show that ?? ̅1 + (1 − ?)? ̅2 where 0 ≤ ? ≤ 1 is an unbiased estimator of ?. b. Find the value...
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.
use R software Suppose that X1, …, Xn are a random sample from a lognormal distribution....
use R software Suppose that X1, …, Xn are a random sample from a lognormal distribution. Construct a 95% confidence interval for the parameter μ. Use a Monte Carlo method to obtain an empirical estimate of the confidence level when data is generated from standard lognormal.
Randomly generate 100 numbers in Excel. These numbers are supposed to be from a normal distribution...
Randomly generate 100 numbers in Excel. These numbers are supposed to be from a normal distribution with mean equal to 1 and standard deviation equal to 5. Use Excel to do the Normality Check. Compare the estimated mean and standard deviation to the actual value (i.e., 1 and 5). Use Monte Carlo Analysis in Excel to estimate the value of π. Choose N= 100, 1000, and 10000 and compare the results.
i.Bias of Sample Mean Draw 20 samples from the normal distribution N(5, 4). Compute the mean...
i.Bias of Sample Mean Draw 20 samples from the normal distribution N(5, 4). Compute the mean of your 20 samples. Report the bias of the sample mean ii. Variance of Sample Mean (Continue of problem i) To estimate the variance of the sample mean, we need to draw many different samples of size 20. Now, we draw 1000 times a sample of size 20. Store all the 1000 sample means. Report the variance of the estimated sample mean. Hint: To...
2) Airline accidents: According to the U.S. National Transportation Safety Board, the number of airline accidents...
2) Airline accidents: According to the U.S. National Transportation Safety Board, the number of airline accidents by year from 1983 to 2006 were 23, 16, 21, 24, 34, 30, 28, 24, 26, 18, 23, 23, 36, 37, 49, 50, 51, 56, 46, 41, 54, 30, 40, and 31. a. For the sample data, compute the mean and its standard error (from the standard deviation), and the median. b. Using R, compute bootstrap estimates of the mean, median and 25% trimmed...
How to do the following in R: Write a function to generate a random sample of...
How to do the following in R: Write a function to generate a random sample of size n from the Gamma(α,1) distribution by the acceptance-rejection method. Generate a random sample of size 1000 from the Gamma(3,1) distribution. (Hint: you may use g(x) ∼ Exp(λ = 1/α) as your proposal distribution, where λ is the rate parameter. Figure out the appropriate constant c).
How to do the following in R: Write a function to generate a random sample of...
How to do the following in R: Write a function to generate a random sample of size n from the Gamma(α,1) distribution by the acceptance-rejection method. Generate a random sample of size 1000 from the Gamma(3,1) distribution. (Hint: you may use g(x) ∼ Exp(λ = 1/α) as your proposal distribution, where λ is the rate parameter. Figure out the appropriate constant c).
Question: Eleven: (a) In a sample of 16 observations from a normal distribution with mean 150...
Question: Eleven: (a) In a sample of 16 observations from a normal distribution with mean 150 and variance of 256. Find the following probabilities i. Ρ ( Χ ≤160) ii. Ρ ( Χ ≥142) (b) The age of employees in a company follows a normal distribution with its mean and variance as 40 years and 121 years, respectively. If a random sample of 36 employees is taken from a normal population of size 1000, what is the probability that the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • Use the given transformation to evaluate the integral. (x − 6y) dA, R where R is...
    asked 14 minutes ago
  • Which document is necessary in establishing outsourcing relationships with an application service provider (ASP)? Service Level...
    asked 23 minutes ago
  • In order to conduct a hypothesis test for the population proportion, you sample 450 observations that...
    asked 29 minutes ago
  • Doctor’s Order: Vancomycin 500mg tab i po q12h X 7 days Available: Vancomycin 500mg tablets What...
    asked 42 minutes ago
  • Calculate the ΔG∘rxn for the reaction using the following information. 4HNO3(g)+5N2H4(l)→7N2(g)+12H2O(l) ΔG∘f(HNO3(g)) = -73.5 kJ/mol; ΔG∘f(N2H4(l))...
    asked 43 minutes ago
  • Question 03: Saturn Shoes (Pvt.) Ltd manufacture multi-style fashion boots for the residents of Missouri. Leather...
    asked 45 minutes ago
  • A highway with a design speed of 100 km/hr is designed with a sag curve connecting...
    asked 57 minutes ago
  • Shift Registers can be used for serial/parallel interface applications. True or false?
    asked 1 hour ago
  • Scenario 1: To describe the instructors’ experience, the researcher records the year in which each instructor...
    asked 1 hour ago
  • develop a flowchart or pseudocode to check the prime numbers 1- below 100 what to do...
    asked 1 hour ago
  • Which of the following statements are true? I. The sampling distribution of ¯xx¯ has standard deviation...
    asked 1 hour ago
  • Which of the following methods of reporting cash flows provided by operating activities does the Financial...
    asked 1 hour ago