In this question, you will explore a new distribution called the uniform distri- bution and use R to conduction a simulation that demonstrates how the CLT works. A uniform random variable is a continuous random variable which PDF looks like a rectangle. It has two parameters: 1) a which specifies the minimum value of the random variable, and 2) b which specifics the maximum value of the random variable. We usually denote a uniform random variable X as X Uniform(a, b). In R, the runif () function

MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
icon
Related questions
Question
In this question, you will explore a new distribution called the uniform distri-
bution and use R to conduction a simulation that demonstrates how the CLT works.
A uniform random variable is a continuous random variable which PDF looks like a
rectangle. It has two parameters: 1) a which specifies the minimum value of the random
variable, and 2) b which specifics the maximum value of the random variable. We usually
denote a uniform random variable X as X~ Uniform(a, b). In R, the runif() function
can be used to generate data from the uniform distribution. In runif (), the default
values for parameters a and b are 0 and 1. Read the help page for runif () and perform
the following:
(a) Generate 1000 data points from Uniform(0, 1). Attach your code.
(b) Use hist() function to draw a histogram of the 1000 data points you generated in
part (a). Describe the shape of the histogram in words. Attach the code and the
histogram.
(c) Now we will use demonstrate how the CLT works. Generate 30 data points from
Uniform(0, 1). Attach the code.
(d) Draw a histogram of the 30 data points. Describe the shape of the histogram in
words. Attach the code and the histogram.
(e) Compute the sample mean of the 30 data points. What is the value of the sample
mean? Attach code.
(f) Use replicate () function to repeat parts (c) and (e) 1000 times. Now you should
have 1000 sample means. Attach your code.
(g) Draw a histogram of the 1000 sample means. Attach the code and the histogram.
(h) Does the histogram in part (g) look normal? Why?
Transcribed Image Text:In this question, you will explore a new distribution called the uniform distri- bution and use R to conduction a simulation that demonstrates how the CLT works. A uniform random variable is a continuous random variable which PDF looks like a rectangle. It has two parameters: 1) a which specifies the minimum value of the random variable, and 2) b which specifics the maximum value of the random variable. We usually denote a uniform random variable X as X~ Uniform(a, b). In R, the runif() function can be used to generate data from the uniform distribution. In runif (), the default values for parameters a and b are 0 and 1. Read the help page for runif () and perform the following: (a) Generate 1000 data points from Uniform(0, 1). Attach your code. (b) Use hist() function to draw a histogram of the 1000 data points you generated in part (a). Describe the shape of the histogram in words. Attach the code and the histogram. (c) Now we will use demonstrate how the CLT works. Generate 30 data points from Uniform(0, 1). Attach the code. (d) Draw a histogram of the 30 data points. Describe the shape of the histogram in words. Attach the code and the histogram. (e) Compute the sample mean of the 30 data points. What is the value of the sample mean? Attach code. (f) Use replicate () function to repeat parts (c) and (e) 1000 times. Now you should have 1000 sample means. Attach your code. (g) Draw a histogram of the 1000 sample means. Attach the code and the histogram. (h) Does the histogram in part (g) look normal? Why?
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
Elementary Statistics: Picturing the World (7th E…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
Introduction to the Practice of Statistics
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman