Change language

Variable evaluation | set 1

Terms related to variability metrics:

 -" Deviation -" Variance -" Standard Deviation -" Mean Absolute Deviation -" Meadian Absolute Deviation -" Order Statistics -" Range -" Percentile -" Inter-quartile Range 
  • Deviation: we can call it — errors or leftovers too. It is a measure of how different / scattered the values ​​are from the central / observed value. 
    Example:
     Sequence: [2, 3, 5, 6, 7, 9] Suppose, Central / Observed Value = 7 Deviation = [-5, -4, -2 , -1, 0, 2] 
  • Variance (with 2 ): This is the most famous measure for assessing variability because it represents is the squared deviation. This can be called the root mean square error, because it is the mean of the standard deviation. 

    Example:

     Sequence: [2, 3, 5, 6, 7, 9] Mean = 5.33 Total Terms, n = 6 Squared Deviation = (2 - 5.33)  2  + (3 - 5.33)  2  + (5 - 5.33)  2  (6 - 5.33)  2  + (7 - 5.33)  2  + (9 - 5.33)  2  Variance = Squared Deviation / n 

    Code —

    # Dispersion

      

    import numpy as np

     

    Sequence = [ 2 , 3 , 5 , 6 , 7 , 9 ]

     

    var = np.var (Sequence)

     

    print ( "Variance:" , var)

    Output:

     Variance: 5.5555555555555545 
  • Standard Deviation: is the square root of the variance. Also referred to as Euclidean norm

    Example:

     Sequence: [2, 3, 5, 6, 7, 9] Mean = 5.33 Total Terms, n = 6 Squared Deviation = (2 - 5.33)  2  + (3 - 5.33)  2  + (5 - 5.33)  2  (6 - 5.33)  2  + (7 - 5.33)  2  + (9 - 5.33)  2  Variance = Squared Deviation / n Standard Deviation = (Variance)  1/2  

    Code —

    # Standard deviation

     

    import numpy as np

     

    Sequence = [ 2 , 3 , 5 , 6 , 7 , 9 ]

     

    std = np.std (Sequence)

     

    print ( "Standard Deviation:" , std)

    Output:

     Standard Deviation: 2.357022603955158 
  • Average absolute deviation: you can estimate the typical estimate of these deviations. If we average the values, negative deviations will displace positive ones. Also, the sum of deviations from the mean is always zero. Thus, this is a simple approach for averaging the deviation itself. 

    Example:

     Sequence: [2, 4, 6, 8] Mean = 5 Deviation around  mean  = [-3, -1, 1, 3] Mean Absolute Deviation = (3 + 1 + 1 + 3) / 4 

    # Average Absolute Deviation

      

    import numpy as np

     

    def mad (data):

    return np. mean (np.absolute (

    data - np. mean (data)))

      

    Sequence = [ 2 , 4 , 6 , 8

      

    print ( "Mean Absolute Deviation: " , mad (Sequence))

    Output:

     Mean Absolute Deviation: 2.0 

Shop

Gifts for programmers

Learn programming in R: courses

$FREE
Gifts for programmers

Best Python online courses for 2022

$FREE
Gifts for programmers

Best laptop for Fortnite

$399+
Gifts for programmers

Best laptop for Excel

$
Gifts for programmers

Best laptop for Solidworks

$399+
Gifts for programmers

Best laptop for Roblox

$399+
Gifts for programmers

Best computer for crypto mining

$499+
Gifts for programmers

Best laptop for Sims 4

$

Latest questions

PythonStackOverflow

Common xlabel/ylabel for matplotlib subplots

1947 answers

PythonStackOverflow

Check if one list is a subset of another in Python

1173 answers

PythonStackOverflow

How to specify multiple return types using type-hints

1002 answers

PythonStackOverflow

Printing words vertically in Python

909 answers

PythonStackOverflow

Python Extract words from a given string

798 answers

PythonStackOverflow

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

606 answers

PythonStackOverflow

Python os.path.join () method

384 answers

PythonStackOverflow

Flake8: Ignore specific warning for entire file

360 answers

News


Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

How to specify multiple return types using type-hints

Printing words vertically in Python

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries

Python add suffix / add prefix to strings in a list

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

Python - Move item to the end of the list

Python - Print list vertically