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...
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....
For this assignment, you are required to write a MIPS program that reads its own instructions...
For this assignment, you are required to write a MIPS program that reads its own instructions and counts the number of occurrences of each type of instruction (R-type, I-type, or J-type). To accomplish this task, your program should execute the following steps: First, your program should load the address of its first instruction (0x400000) into a register, and initialize three separate instruction class counters to zero. Next, your program should enter a loop that reads each instruction from memory. For...
Please Answer all question and please in detail. The assignment should include an abstract, introduction, conceptual...
Please Answer all question and please in detail. The assignment should include an abstract, introduction, conceptual building of sustainable financial management and sustainable financial growth, results and discussions sections, the project should also include conclusion section. 1. Examining the existing various corporate sustainable reporting disclosure and how they contributes to shared value creation and firms value. 2. Improving financial decision making by linking sustainability issues to financial decisions and key value drivers, such as capital budgeting, the cost of capital,...
In this assignment, you will be required to use the Heart Rate Dataset to complete the...
In this assignment, you will be required to use the Heart Rate Dataset to complete the following: Identify the types of data represented by variables The range or types of values for each variable Give a brief written description of the variables, and how they are used in the data set. Steps Open the Heart Rate Dataset in Excel Identify each of the variables contained in the dataset by type Identify the type of data each variable represents (e.g., qualitative...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT