Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Covariance

This folder contains two Python programs that calculate the Covariance of a dataset. Both programs use different libraries for Covariance calculation.

Description

Covariance is a statistical measure that helps us understand the relationship between two random variables. It measures how changes in one variable correspond to changes in another variable. In simple terms, it indicates the degree to which the variables move together. A positive covariance means that the variables tend to move in the same direction, while a negative covariance indicates they move in opposite directions. Covariance provides important information when analyzing the dependence and potential correlation between variables. More Information

              __________________________________________________________________________________
              |                                                                                 |
              |                 The formula for covariance is as follows:                       |
              |                ___________________________________________                      |
              |               |                                           |                     |
              |               |   Cov(x, y) = ∑((xᵢ - μₓ)(yᵢ - μᵧ)) / N   |                     |
              |               |___________________________________________|                     |
              |                                                                                 |
              |       --->   Cov(x, y) = represents covariance between the datasets             |
              |       --->   Σ = sum of                                                         |
              |       --->   xi = represents each individual value in the first dataset         |
              |       --->   yi = represents each individual value in the second dataset        |
              |       --->   μₓ = represents the mean of the first dataset                      |
              |       --->   μᵧ = represents the mean of the second dataset                     |
              |       --->   N = represents the total number of values in the datasets          |
              |_________________________________________________________________________________|

Usage

  1. Run the program.
  2. You will be prompted to enter a list of data, separated by spaces.
  3. Input the desired data points.
  4. The program calculates and displays the covariance.
  • Both programs are included in this repository, with separate files for each.

References