Computer Assignment 2 - Stockholms universitet
Computer Assignment 2 - Stockholms universitet
Computer Assignment 2 - Stockholms universitet
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
1.2 The Normal DistributionThe probability density function for the normal distributionf(x) = √ 1 e − (x−µ)22σ 22πσcan be determined in Matlab through the function normpdf(x,m,s) as>> normpdf(1.5,2,0.7)ans =0.4416for x = 1.5, µ = 2 and σ = 0.7. Note that the third argument is the standrad deviationand not the variance.The cumulative distribution functionF (x) =∫ x−∞can be calculated using normcdf(x,m,s) as>> normcdf(1.5,2,0.7)ans =0.23751√ e − (y−µ)22σ 2 dy2πσIf you are interested in the corresponding functions for the standard normal distribution,it is not necessary to state the last two arguments. Instead you can write>> normpdf(1.5)ans =0.1295>> normcdf(1.5)ans =0.93323