You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
224 B
10 lines
224 B
2 years ago
|
FUNCTION myCov(x, y) {
|
||
|
center_x := x - avg(x);
|
||
|
center_y := y - avg(y);
|
||
|
num := sum(center_x * center_y);
|
||
|
denom := sqrt(sum(center_x * center_x)) * sqrt(sum(center_y * center_y));
|
||
|
num / denom
|
||
|
}
|
||
|
|
||
|
|
||
|
select myCov(1,2);
|