![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | Calculation for Skewness and Kurtosis using TSeriesStatsTool | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | Nina Kajiji <nina> |
| Component: | Tools | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | IN_PROGRESS --- | ||
| Severity: | enhancement | CC: | david, yeray |
| Priority: | --- | ||
| Version: | 19.161025 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | FastLine | Delphi / C++ Builder RAD IDE Version: | RAD XE8 |
| Attachments: |
Contains the data and a snapshot of the output and TeeChart code
test xls and report pdf Small test project |
||
Created attachment 865 [details]
test xls and report pdf
I attack here the test xls and the report from Nina Kajiji.
Thanks for the analysis!
In progress.
Adding support for "Complete" calculation. This code was created without considering the different alternatives, so originally the Std Deviation was only used at the end of the calculation, not while accumulating the sum of differences.
Still not totally correct, pending to check.
with Series,MandatoryValueList do
if Count>0 then
tmpMean:=Total/Count
else
tmpMean:=0;
for t:=0 to Series.Count-1 do
begin
tmp:=(Series.MandatoryValueList.Value[t]-tmpMean);
// https://www.steema.com/bugs/show_bug.cgi?id=2110
if Complete then
tmp:=tmp/tmpStdDeviation;
result:=result+Power(tmp,Exponent);
end;
end;
Created attachment 1038 [details]
Small test project
Test project with the same data of the Excel sheet.
|
Created attachment 863 [details] Contains the data and a snapshot of the output and TeeChart code The calculation of Skewness and Kurtosis using the TSeriesStatsTool is giving different answers compared to that of SAS (with vardef=df option), SPSS and Excel. All three provide comparable numbers. The mean and standard deviation calculations from TeeChart are comparable to that of the statistical programs. I am including an .XLS file with the data I am using. The Teechart code is also attached. Teecharts answers are: Skewness = 0.916 Kurtosis = 3.658 Excels answers are: Skewness = 0.965 Kurtosis = 1.032 I also show the traditional calculation for Kurtosis which appears in textbooks such as Snedecor and Cochran (1967). By that method the calculation should be 3.7544. So I am not sure what formulas are being used in Teechart. I would really appreciate if you could clarify the computational differences I observe. Thanks, Nina