Download MAR-550_LabInOceanogr_wk4

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Laboratory in Oceanography:
Data and Methods
Computing Basic Statistics
MAR550, Spring 2013
Miles A. Sundermeyer
Sundermeyer
MAR 550
Spring 2013
1
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
2
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
3
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Basic Statistics
Let a  a1 , a2 ,, an
• min, max
- absolute minimum and maximum values of data
(see also nanmin, nanmax)


1 n
a

i 1 i
n
•
mean
- mean (a)  a 
•
median
- the value separating the higher half of a sample population, or
probability distribution, and the lower half;
•
mode
- the value that has the largest number of observations
Note: The mode function is most useful with discrete or coarsely rounded data.
The mode for a continuous probability distribution is defined as the peak of its
density function. Application to a sample from such a distribution is unlikely to
provide a good estimate of the peak; it would be better to compute a
histogram or density estimate and calculate the peak of that estimate. Also,
the mode function is not suitable for finding peaks in distributions with multiple
modes.
Sundermeyer
MAR 550
Spring 2013
4
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
5
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
6
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Variance and Standard Deviation
•
var
2
1 n
- variance of a =  ai  a 
n i 1
Note: The above calculation of variance is biased low; for unbiased variance,
must normalize by (n-1). By default, Matlab computes the unbiased variance,
i.e.,
2
1
n
a  a 

n 1
i 1
•
std
Sundermeyer
MAR 550
Spring 2013
i
- standard deviation of a = sqrt(var(a))
7
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
8
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Percentiles
•
prctile
- Percentile (or centile) is the value of a variable below which a
certain percent of observations fall; e.g., the 20th percentile is
the value (or score) below which 20 percent of the observations
may be found.
•
cdfplot
- Plots the cumulative distribution function (CDF) of the
observations in the data sample vector.
Sundermeyer
MAR 550
Spring 2013
9
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
10
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
11
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Normality
• Gaussian
- Gaussian or Normal distribution is the probability distribution
function given by:
1
e
 2

( x x )2
2 2
Noteworthy features of Gaussian distributions
• symmetry about its mean
• the mode and median both equal the mean
• the inflection points of the distribution curve occur one standard deviation
away from the mean, i.e. at (x − σ) and (x + σ)
• Exist numerous tests for normality, e.g., Lilliefors, Kolmogorov-Smirnov,
Jarque-Bera, and others. Also many more general tests for comparing
distributions.
Sundermeyer
MAR 550
Spring 2013
12
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
13
Computing Basic Statistics
see also: http://www.mathworks.com/access/helpdesk/help/toolbox/stats/
Sundermeyer
MAR 550
Spring 2013
14
Computing Basic Statistics
Useful Tidbits …
Useful Tidbits
•
if <expression>
statements
elseif <expression>
statements
else
statements
end
e.g.,
n=rand(1)
if (n>0.5)
disp('heads')
elseif (n<0.5)
disp('tails')
else
disp('neither!')
end
Sundermeyer
MAR 550
Spring 2013
15
Computing Basic Statistics
Useful Tidbits …
Useful Tidbits
•
while <expression>
statements
end
e.g.,
n=rand(1)
while n>0.5
if (n>0.5)
disp('heads')
elseif (n<0.5)
disp('tails')
else
disp('neither!')
break
end
n=rand(1)
end
Sundermeyer
MAR 550
Spring 2013
16
Computing Basic Statistics
Useful Tidbits …
Gaussian Distribution
Sundermeyer
MAR 550
Spring 2013
17
Computing Basic Statistics
Useful Tidbits …
Random Walk in 2-D
Sundermeyer
MAR 550
Spring 2013
18
Related documents