Generation of pseudo-random normal rvs. generate sample size of l rvs,
each iid n(mu, si...
Mathematics, 08.11.2019 01:31 lovelyheart5337
Generation of pseudo-random normal rvs. generate sample size of l rvs,
each iid n(mu, sigma^2) rvs. histogram these with nbins =25; see myhistc. m under files, or use your own. however, read the next section because an overlay is required.
develop a plot where you overlay the normalized histogram (with area 1) with the theoretical pdf. show the goodness of fit is good using a chi-squared test. you should know this from your earlier stats class. take mu=-6, sigma^2 = 2; try different sample sizes of l = 10^2,10^3,10^4.
since these are generated using randn, the fit will be excellent and the chi-squared will be small.
myhistc. m
function [xknt, outknt, xcenter, xdelta] = myhistc(x, nbins, xend);
%function [xknt, outknt, xcenter, xdelta] = myhistc(x, nbins, xend);
% a histogram with nbins within the range [xend(1), xend(2)]
% xend (1: 2), for edges, beyond xend, data is counted in outknt
flagprint = 1; %change to 1 for printing and plotting
x = x(: ); lx = length(x);
outknt = zeros(2,1); xknt = zeros(nbins,1);
lindx=0; indx=find(x < = xend(1)); lindx=length(indx); if(lindx ~= 0); outknt(1)=lindx; end
x(indx)=[];
lindx=0; indx=find(x > xend(2)); lindx=length(indx); if(lindx ~= 0); outknt(2)=lindx; end
x(indx)=[];
xdelta = (xend(2)-xend(1))/nbins; xbin = xend(1) + [0: nbins]*xdelta;
xcenter = zeros(nbins,1);
% loop over the few bins, not over the many data
for ibin=[1: nbins]; % loop over bins, not data
lindx=0; indx=find( (xbin(ibin)< x)& ( x < =xbin(ibin+1)) ); lindx=length(indx);
xcenter(ibin) = mean([xbin(ibin) xbin(ibin+1)]);
if(lindx~=0); xknt(ibin)=lindx; end%%x(indx)=[]; end
%disp([ibin, xbin(ibin) xbin(ibin+1) xcenter(ibin) xknt(ibin)])
end
if(flagprint==1);
format bank
disp([' binid lowedge upedge center count'])
for ibin=[1: nbins]; % loop over bins, not data
disp([ibin, xbin(ibin) xbin(ibin+1) xcenter(ibin) xknt(ibin)])
end
end
format short e
if(flagprint==1);
plot( xcenter, xknt,'r*-'); grid
end
Answers: 2
Mathematics, 21.06.2019 17:00
Which inequality comparing two of the expressions is true when 0.7 < x < 0.9
Answers: 1
Mathematics, 21.06.2019 18:30
Aball is thrown from a height of 139 feet with an initial downward velocity of 15 ft/s. the ball's height h (in feet) after t seconds is given by the following. h=139-15t-16t^2 how long after the ball is thrown does it hit the ground? round your answer(s) to the nearest hundredth. (if there is more than one answer, use the "or" button.) t =
Answers: 1
Mathematics, 21.06.2019 20:00
Afrequency table of grades has five classes (a, b, c, d, f) with frequencies of 3, 13, 14, 5, and 3 respectively. using percentages, what are the relative frequencies of the five classes?
Answers: 3
Mathematics, 21.06.2019 22:40
Ntriangle abc, m∠a = 35° and m∠b = 40°, and a=9. which equation should you solve to find b?
Answers: 2
Mathematics, 18.12.2019 08:31
Advanced Placement (AP), 18.12.2019 08:31
History, 18.12.2019 08:31
English, 18.12.2019 08:31
Mathematics, 18.12.2019 08:31
Mathematics, 18.12.2019 08:31
Mathematics, 18.12.2019 08:31
Health, 18.12.2019 08:31
Mathematics, 18.12.2019 08:31
Biology, 18.12.2019 08:31