# 22. Virtuoso Functions Guide - COVAR_SAMP

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
corr
covar_pop
covar_samp
regr_avgx
regr_avgy
regr_count
regr_intercept
regr_r2
regr_slope
regr_sxx
regr_sxy
regr_syy
stddev
stddev_pop
stddev_samp
var
var_pop
var_samp
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## COVAR_SAMP

Returns the sample covariance of a set of number pairs.
numeric COVAR_SAMP (in expr1 any, in expr2 any);
Description

COVAR_SAMP returns the sample covariance of a set of number pairs. Both expr1 and expr2 are numeric expressions. Virtuoso applies the function to the set of (expr1, expr2) pairs after eliminating all pairs for which either expr1 or expr2 is null. Then Virtuoso makes the following computation:

    (SUM(expr1 * expr2) - SUM(expr2) * SUM(expr1) / n) / (n-1)

where n is the number of (expr1, expr2) pairs where neither expr1 nor expr2 is null.

Parameters
expr1 – Number expression.
expr2 – Number expression.
Return Types

The function returns a value of type NUMERIC. If the function is applied to an empty set, then it returns null.

See Also

VAR()

VAR_SAMP()

VAR_POP()

STDDEV()

STDDEV_SAMP()

STDDEV_POP()

REGR_SYY()

REGR_SXX()

REGR_SXY()

REGR_AVGX()

REGR_AVGY()

REGR_R2()

REGR_COUNT()

REGR_INTERCEPT()

REGR_SLOPE()

COVAR_SAMP()

COVAR_POP()

CORR()