Question

In: Statistics and Probability

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 3 :

In lab lecture notes and demo code, I simulated random samples from Exp(1) to verify classical central limit theorem numerically. I also stressed that no matter what type of random samples you use, the standardized partial sum Sn always converge to N(0, 1). In this problem, simulate random samples from the following distributions:

1. Bernoulli(0.5) with µ = 0.5 and σ^2 = 0.25. (Hint: You can use rbinom to generate Bernoulli random numbers.) 1

2. Uniform(0, 1) with µ = 0.5 and σ^2 = 1/12.

3. Possion(1) with µ = 1 and σ^2 = 1.

For each case, set simulation times N to be 1000 and for each simulation, generate n = 2000 random numbers. Report 3 pieces of code, 3 Q-Q plots and your conclusion. To get all the answers, you only need slightly adjust my demo code

Solutions

Expert Solution

Bernoulli(0.5)

N <- 2000 # Number of trials (population size)
n <- 1000 # Number of simulations
standardized_sample_mean = rep(0,s)
EX <- 0.5 #Expectation
VarX <- 0.25 #Variance
for (i in 1:n){
samp <- rbinom(1, size = N, prob = 0.05) #Sampling the Distribution
sample_mean <- mean(samp) # sample mean
standardized_sample_mean[i] <- sqrt(N)*(sample_mean - EX)/sqrt(VarX) #Standarizing the Sample Mean
}
hist(standardized_sample_mean,prob=TRUE)
qqnorm(standardized_sample_mean)

Uniform(0, 1)

N <- 2000 # Number of trials (population size)
n <- 1000 # Number of simulations
standardized_sample_mean = rep(0,s)
EX <- 0.5 #Expectation
VarX <- 0.25 #Variance
for (i in 1:n){
samp <- runif( N, 0, 1) #Sampling the Distribution
sample_mean <- mean(samp) # sample mean
standardized_sample_mean[i] <- sqrt(N)*(sample_mean - EX)/sqrt(VarX) #Standarizing the Sample Mean
}
hist(standardized_sample_mean,prob=TRUE)
qqnorm(standardized_sample_mean)

Possion(1)

N <- 2000 # Number of trials (population size)
n <- 1000 # Number of simulations
standardized_sample_mean = rep(0,s)
EX <- 1 #Expectation
VarX <- 1 #Variance
for (i in 1:n){
samp <- rpois(N,1) #Sampling the Distribution
sample_mean <- mean(samp) # sample mean
standardized_sample_mean[i] <- sqrt(N)*(sample_mean - EX)/sqrt(VarX) #Standarizing the Sample Mean
}
hist(standardized_sample_mean,prob=TRUE)
qqnorm(standardized_sample_mean)


Related Solutions

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 1 : Consider a binomial random variable X ∼ Bin(100, 0.01). 1. Report P(X = 7), P(X = 8), P(X = 9), try to use one ONE R command to return all these three values. 2. Find the probability P(0...
PLEASE READ ALL OF THESE INSTRUCTIONS BEFORE BEGINNING THIS ASSIGNMENT. For this assignment, you need to...
PLEASE READ ALL OF THESE INSTRUCTIONS BEFORE BEGINNING THIS ASSIGNMENT. For this assignment, you need to analyze the information below from BOTH the management AND the employee perspective. This information pertains to a labor union in a simulated/made up/not real firm in Glen Ellyn. The first part of your information relates to Management – the second part relates to the Labor Union employees. I have provided you with information from the last union negotiations at the plant in 2016. It...
Instructions Please answer all questions Use the given dataset “Homework_EX_1”. Please include the relevant SPSS output...
Instructions Please answer all questions Use the given dataset “Homework_EX_1”. Please include the relevant SPSS output (such as tables and graphs). Include the screen snapshots of how you specify the model in SPSS (use the “Print_screen” function in your keyboard to capture each screen and paste it in the word document). Please provide a clear WELL-WRITTEN interpretation for each question. Name Variable information Diabetes Diabetes status (Yes, No) Age Age measured in years Race Race of each woman described as...
Please follow these instructions to complete this assignment: 1. For this assignment, you are to develop...
Please follow these instructions to complete this assignment: 1. For this assignment, you are to develop 10 questions that you would ask a management official responsible for the financial planning for the organization you have chosen to research for the week 3 paper. 2. Make sure the questions will give you insight into what the company looks for when preparing their yearly budget, fiscal planning strategies, as well as how they monitor their financial condition throughout the year and make...
Assignment Description and Instructions: As a group of prospective entrepreneurs, you are required to prepare a...
Assignment Description and Instructions: As a group of prospective entrepreneurs, you are required to prepare a business plan for a new skin care business (not an existing business/company) to acquire financing. ALL group members are expected to collaborate and contribute to the business plan. Each member will be required to complete peer evaluation of the other team members using the rubric provided. The plan is expected to include: Title page. This should include the company’s name, logo, address and contact...
I want to use R markdown to do the following questions and render a pdf for...
I want to use R markdown to do the following questions and render a pdf for all the answers!!! Q1. Suppose we toss 4 coins (each having heads probability = (1/2). Let X denote the random variable: (number of heads) - (number of tails). (a) What is the range of X? (give exact upper and lower bounds along with a line of explanation) (b) What is the probability mass function of (c) What is the cumulative density function of X...
Instructions (In C++ Please) Verification This programming lab makes use of an array of characters. The...
Instructions (In C++ Please) Verification This programming lab makes use of an array of characters. The program will validate the characters in the array to see if they meets a set of requirements. Requirements: Must be at least 6 characters long (but not limited to 6, can be greater) Contains one upper case letter Contains one lower case letter Contains one digit Complete the code attached. Must use pointer while checking the characters. Download Source Lab 3 File: #include using...
Program Assignment 1 C++ please Instructions This assignment will require the use of three arrays, which...
Program Assignment 1 C++ please Instructions This assignment will require the use of three arrays, which will be used in parallel. Create a program that keeps track of the sales of BBQ sauces for a company. The company makes several different types of sauces, Original, Sticky Sweet, Spicy, Sweet Heat, Hickory Bourbon and Smokey Mesquite. One array will contain the names of the different BBQ sauces. This array will be initialized from a text file with the 6 different names....
Instructions This assignment is to be typed up in the supplied R-Script. You need to show...
Instructions This assignment is to be typed up in the supplied R-Script. You need to show all of your work in R in the given script. Be sure and use # in front of any text that you type in. You are allowed to work with your peer group, but please site your sources! If you get help from anyone, you need to mention that in your write up. This assignment is worth 60 points (10 per problem) and you...
Instructions This assignment is to be typed up in the supplied R-Script. You need to show...
Instructions This assignment is to be typed up in the supplied R-Script. You need to show all of your work in R in the given script. Be sure and use # in front of any text that you type in. You are allowed to work with your peer group, but please site your sources! If you get help from anyone, you need to mention that in your write up. This assignment is worth 60 points (10 per problem) and you...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT