25.10.2016 Views

SAP HANA Predictive Analysis Library (PAL)

sap_hana_predictive_analysis_library_pal_en

sap_hana_predictive_analysis_library_pal_en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.7.1 Chi-Squared Test for Goodness of Fit<br />

The chi-squared test for goodness of fit tells whether or not an observed distribution differs from an expected<br />

chi-squared distribution.<br />

The chi-squared value is defined as:<br />

where O i is an observed frequency and E i is an expected frequency.<br />

The chi-squared value X 2 will be used to calculate a p-value by comparing the value of chi-squared to a chisquared<br />

distribution. The degree of freedom is set to n-p where p is the reduction in degrees of freedom.<br />

Prerequisites<br />

●<br />

●<br />

The input data has three columns. The first column is ID column with integer, varchar, or nvarchar type;<br />

the second column is the observed data with integer or double type; the third column is the expected<br />

frequency.<br />

The input data does not contain null value. The algorithm will issue errors when encountering null values.<br />

CHISQTESTFIT<br />

This function does the Pearson’s chi-squared test for goodness of fit according to the user’s input.<br />

Procedure Generation<br />

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE (‘AFL<strong>PAL</strong>’, ‘CHISQTESTFIT’,<br />

‘’, '', );<br />

The signature table should contain the following records:<br />

Table 365:<br />

Position Schema Name Table Type Name Parameter Type<br />

1 IN<br />

2 <br />

3 <br />

OUT<br />

OUT<br />

Procedure Calling<br />

CALL . (, ,<br />

) with overview;<br />

494 P U B L I C<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Predictive</strong> <strong>Analysis</strong> <strong>Library</strong> (<strong>PAL</strong>)<br />

<strong>PAL</strong> Functions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!