1
answer
0
watching
31
views
ivorybat714Lv1
9 Sep 2020
Please use python codes 1. Simulate 100,000 realizations from the binomial distribution with N=1000 trails and success probability p=0.3. In ( ): import numpy as np import math import matplot lib.pyp lot as plt 2. Compute the empirical mean and the empricial standard deviation of your sample and compare these values with the theoretical values. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! 3. Plot a histogram of your sample with the absolute number of counts for each bin. Choose 25 bins. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! 4. Standardize your sample, that is, subtract the emprical mean and divide by the empricial standard deviation. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! 5. Plot a histogram of your standardized sample with the counts normalized to form a probability density. Choose again 25 bins. Compare your histrogram with the density of the standard normal distribution by inserting its density into the histogram plot. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE!
Please use python codes 1. Simulate 100,000 realizations from the binomial distribution with N=1000 trails and success probability p=0.3. In ( ): import numpy as np import math import matplot lib.pyp lot as plt 2. Compute the empirical mean and the empricial standard deviation of your sample and compare these values with the theoretical values. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! 3. Plot a histogram of your sample with the absolute number of counts for each bin. Choose 25 bins. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! 4. Standardize your sample, that is, subtract the emprical mean and divide by the empricial standard deviation. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! 5. Plot a histogram of your standardized sample with the counts normalized to form a probability density. Choose again 25 bins. Compare your histrogram with the density of the standard normal distribution by inserting its density into the histogram plot. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE!
parvpaigwarLv4
13 Feb 2023
Unlock all answers
Get 1 free homework help answer.
Already have an account? Log in