Descriptive statistics
Descriptive statistics is the discipline of statistics, where information and features, which explain the essence of data, are extracted and analyzed. This part is very important, as it helps us estimate the shape and features of data for model and algorithm selection.
Getting ready
You have to have the StatsBase
package ready. This can be done by running using StatsBase
in the REPL.
How to do it...
- The variance of a vector can be found using the
var()
function. This can be done by the following:var(x)
The output would look like the following:
- For calculating the weighted variance of the vector x with respect to weight vector w, both of them can be simply added to the
variance()
function as arguments: - For calculating the standard deviation, the
std()
function can be used. This can be done by executing the following in the REPL:std(x)
The output would look like the following:
- As with the calculation of the preceding variance, the weighted...