1. Find the (sample) means of the GDP and the LSI and store them as mX and mY .
Suggestion: You may wish to try the MATLAB functions mean(x) and mean(y).
2. Find the (sample) standard deviation of the GDP and the LSI and store them as stdX and stdY .
Suggestion: You may wish to try the MATLAB functions std(x) and std(y).
3. Find the range (i.e., the maximum and the minimum values) of the GDP.
Suggestion: You may wish to try the MATLAB functions max(x), min(x) and range(x).
4. Divide the range into N = 8 equal-length segments (hereafter called “bins”) and for each bin, find its
bound (aj , bj ) as well as its center cj for j = 1, 2,…, 8.
Suggestion: It might be convenient to store aj ’s in a vector a, bj ’s in a vector b and cj ’s in a vector c
with an appropriate length.
5. Sort the data and place each GDP value xi into that bin whose lower bound is less than or equal to xi
and whose upper bound is greater than xi; thereafter, for each bin count the number of xi assigned to
it (= nj ).
6. (2pt) Plot a histogram of the measured GDP using N = 8 bars
Back
Uncategorized
2 min read
GDP and the LSI
-
- Author David Lee
- Published January 10, 2020