covariance
- Details
- Last Updated on Friday, 18 January 2013 22:37
syntax
- cov(a, b)
- cov(a, b, partioning)
definition
- cov(a, b) results in a parameter with the covariance of attributes a and b.
- cov(a, b, partioning) results in an attribute with the covariance of attributes a and b, grouped by the partioning attribute. The domain unit of the resulting attribute is the values unit of the partioning attribute.
applies to
Attributes a and b with value types:
- group: Numeric
conditions
- Attributes a and b need to match with regard to their value type.
- Attributes a, b and partition need to match with regard to their domain unit.
since version
5.15
example
1. parameter<float32> covNrInhabitantsTemp:
expr = "cov(float32(City/NrInhabitants), City/avgDailyTemperature)";
result = -156.25
2. attribute<float32> covNrInhabitantsTempRegion (RegionDomain): expr =
"cov("
" float32(City/NrInhabitants)"
", City/avgDailyTemperature"
", City/RegionNr"
")";
| City/NrInhabitants | City/avgDailyTemperature | City/RegionNr |
| 550 | 12 | 0 |
| 525 | 11 | 1 |
| 300 | null | 2 |
| 500 | 11 | 1 |
| 200 | 14 | 3 |
| 175 | null | null |
| null | 14 | 3 |
| covNrInhabitantsTempRegion |
| 0 |
| 0 |
| null |
| 0 |
| null |