New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add statistical fucntions (as agreg.?) [CORE638] #1002
Comments
Modified by: Alice F. Bird (firebirds)description: SFID: 807974# May be implemented in Firebird some statistical - computing of Median How can be computed: Median - sort by values and get central value standard deviation = Skew = Kurtosis Standard deviation, Kurtosis and Skew not teoretical r-th common moment: r-th central moment: => SFID: 807974# May be implemented in Firebird some statistical - computing of Median How can be computed: Median - sort by values and get central value standard deviation = Skew = Kurtosis Standard deviation, Kurtosis and Skew not teoretical r-th common moment: r-th central moment: |
Commented by: Umberto Masotti (umasotti) these functions are aggregates, and need a result set to give a singleton answer. How can be passed a vector of results to a UDF? Thay can be implemented simpler as internal function, as SUM(), COUNT(), AVG() are. |
Modified by: @pcisarWorkflow: jira [ 10662 ] => Firebird [ 15013 ] |
Commented by: ramengo (ramengo) When will be implemented these statistical functions ? |
Commented by: @dyemanov Definitely, not in v2.5. |
Commented by: Dietrich Streifert (level420) It would be definitely a benefit to have stddev and median as internal agregate functions. |
Commented by: Ivan (patuljak) I think is be better if this support in UDF. |
Commented by: Firebird User unter Windows7 (winfire) I would prefer a internal implementation in V3 like other databases does. |
Submitted by: @pcisar
Votes: 4
SFID: 807974#
Submitted By: pcisar
May be implemented in Firebird some statistical
functions?
- computing of Median
- computing of Standard deviation (StdDev)
- computing of Skew
- computing of Kurtosis
- common and central statistical moments
How can be computed:
Median - sort by values and get central value
PHP example:
$this->int_get_sorted_data();
$count = $this->data_count;
$data = $this->data_sorted;
if ($count % 2){
$mediane = $data[($count - 1) / 2];
} else {
$mediane = ($data[$count/2] + $data[$count/2 -
1]) / 2;
}
standard deviation =
= sqrt(1/(count(X) - 1) * sum(Xi - avg(x)))
= sqrt((sum(Xi^2) - (sum(Xi)^2)/(count(X) - 1))
Skew =
(count(X) * (sum((Xi - avg(X))^3))) /
((count(X)-1)*(count(X)-2)*stddev(X)^3))
Kurtosis
= (n*(n+1)*sum((Xi - avg(X))^4))/((n-1)*(n-2)*(n-3)
*stddev^4 - (3*(n-1)^2)/((n-2)*(n-3))
n = count(X)
Standard deviation, Kurtosis and Skew not teoretical
but selective (select).
r-th common moment:
MU'r(X) = avg(Xi^r)
r-th central moment:
MUr(X) = avg((Xi - avg(X))^r)
The text was updated successfully, but these errors were encountered: