Question

5) R Code: Overlap a histogram of 10000 random values from Z ∼ N(0,1) with the...

5) R Code:
Overlap a histogram of 10000 random values from Z ∼ N(0,1) with the histogram below. Include your code
X = hist(replicate(10000, (mean(rbinom(50, 1, 0.1))))

Homework Answers

Answer #1

R-Code;

X = hist(replicate(10000, (mean(rbinom(50, 1, 0.1)))))
X

Histogram:

Now We Overlap a histogram of 10000 random values from Z ∼ N(0,1) with the histogram

R-code:

X = hist(rnorm(10000, mean=0, sd=1))
X

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
Consider the R code n <- 10000 sample<-rbinom(1,size,prob=0.2) proportion <-sample/n Describe what the line containing rbinom...
Consider the R code n <- 10000 sample<-rbinom(1,size,prob=0.2) proportion <-sample/n Describe what the line containing rbinom does. 1/proportion will, with high probability, be close to a particular whole number.  Which one? Give justification for your answer, including the names of any standard results that you use.
Question 4(4 point) 4.1) Which of the following produces a probability histogram? Hist(1:1000, probability=TRUE) , histogram(1:1000,...
Question 4(4 point) 4.1) Which of the following produces a probability histogram? Hist(1:1000, probability=TRUE) , histogram(1:1000, probability=TRUE) hist(rexp(1000,3)) hist(rbinom(1000, 10, 0.2)) Noe of these 4.2) Which of the following R code generates 1000 random variates from an Exponential distribution with mean 1/3? rexp(1000, rate=1/3) rexp(1/3, 1000) rexp(1000, rate=3) rexp(3, 1000) None of these 4.3) Which of the following R code generates 1000 random variates from a Normal distribution with mean 10 and variance 4? rnorm(1000, 10, 4) rnorm(1000, 4, 10)...
R Simulation: For n = 10, simulate a random sample of size n from N(µ,σ2), where...
R Simulation: For n = 10, simulate a random sample of size n from N(µ,σ2), where µ = 1 and σ2 = 2; compute the sample mean. Repeat the above simulation 500 times, plot the histogram of the 500 sample means (does it mean that I can just use hist() method instead of plot() method). Now repeat the 500 simulations for n = 1,000. Compare these two sets of results with different sample sizes, and discuss it in the context...
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.
Below is R code (R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night") to plot a...
Below is R code (R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night") to plot a pareto distribution. For part (c), I'm unable to get the density curve to show up in the histogram. Thanks! Problem 1. The Pareto distribution has been used in economics as a model for a density function with a slowly decaying tail. The Pareto($a$,$b$) distribution has pdf $$ f(x) = \frac{ab^{a}}{x^{a+1}}, \quad x \geq b $$ Set the seed number set.seed(210) (a) Use the inverse...
1.) Work through code on finding QQ-plot of a sequence of numbers shown on kaggle (no...
1.) Work through code on finding QQ-plot of a sequence of numbers shown on kaggle (no need to submit). Generate 10000 random numbers from N(50,4), store them as a vector. It is expected that the sample mean of this vector should be close to the population mean 50. Verify this. Suppose X~NB(3,0.8). More specificly, let X be the total numbers needed to achieve 3rd success in a sequence of independent repeated Bernoulli trials with success probability 0.8. Report the probability...
Question 6. Using only a random number generator that simulates a random number between [0,1], simulate...
Question 6. Using only a random number generator that simulates a random number between [0,1], simulate 1,000 iterations of the following random variables: a) X ~ exp(5) b) X such that f(x) = 3x2 , 0 ≤ x ≤ 1 For both (a) and (b), plot a histogram of your simulated random variable. Estimate ?̅ and s2. Compare these values to E(X) and Var(X).
Let C [0,1] be the set of all continuous functions from [0,1] to R. For any...
Let C [0,1] be the set of all continuous functions from [0,1] to R. For any f,g ∈ C[0,1] define dsup(f,g) = maxxE[0,1] |f(x)−g(x)| and d1(f,g) = ∫10 |f(x)−g(x)| dx. a) Prove that for any n≥1, one can find n points in C[0,1] such that, in dsup metric, the distance between any two points is equal to 1. b) Can one find 100 points in C[0,1] such that, in d1 metric, the distance between any two points is equal to...
Instructions: You are not required to use R markdown for the lab assignment. Please include ALL...
Instructions: You are not required to use R markdown for the lab assignment. Please include ALL R commands you used to reach your answers in a word or pdf document. Also, report everything you are asked to do so Problem 2 : Answer the following questions: 1. First run alphas <- seq(0.1, 1, by = 0.1) and nalphas <- - rev(alphas). Based on what you have seen, describe how functions seq and rev work. Then run qnorm(c(nalphas, alphas)) and report...
I have the following R code n <- 10 samples_0 <- 5 x <- 25 samples...
I have the following R code n <- 10 samples_0 <- 5 x <- 25 samples <- matrix(c(runif(n*samples_0, 0, x)), ncol=n) theta1 <- ((n + 1) / n) * samples theta2 <- (n + 1) * samples var(theta1) var(theta2) If the code above was run on an infinitely large samples_0, what would the values of the variance of theta1 (var(theta1) in code) and theta2 (var(theta2)) be to 11 decimal places?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT