BENG 449 Problem 2 3 C

BENG 449 Problem 2 3 C - 5:53 PM C\Documents and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2/7/08 5:53 PM C:\Documents and Settings\Alex Lemon...\BENG 449 Problem 2 3 C.m 1 of 1 % BENG 449 -- Problem Set 2, Question 3 (Part 3) % Written by Alex Lemon clear filtered_data % Create a histogram of the sample_medians minimum_bin = mu - 3 * sigma / sqrt(n); maximum_bin = mu + 3 * sigma / sqrt(n); delta_bin = 1 / sqrt(4 * n); bins = minimum_bin:delta_bin:maximum_bin; counter = 1; for i = 1:num_rep current = sample_medians(i); if (abs(current - mu) < 3 * sigma /sqrt(n)) filtered_data(counter) = current; counter = counter + 1; end end hist(filtered_data, bins); title('Histogram of Sample Medians (100 Samples)'); xlabel('Sample Median'); ylabel('Observed Frequency'); hold on; x = minimum_bin:(delta_bin / 100):maximum_bin; plot(x, sqrt(n) / sigma * delta_bin * num_rep * normpdf(sqrt(n) / sigma * (x - mu))); hold off; ...
View Full Document

This note was uploaded on 07/19/2008 for the course BENG 449 taught by Professor Richardcarson during the Spring '08 term at Yale.

Ask a homework question - tutors are online