This content explains the concept of multivariate analysis and provides formulas for calculating the covariance matrix and Pearson's correlation coefficient matrix. The covariance matrix measures the covariance between any two random variables, while the Pearson's correlation coefficient matrix measures the correlation between two random variables. The formulas for both matrices are provided, along with an explanation of how to treat each column as a data sample.
------

SET SCHEMA DM_PAL;

DROP TABLE PAL_MULTIVARSTAT_DATA_TBL;
CREATE COLUMN TABLE PAL_MULTIVARSTAT_DATA_TBL (
	"X" INTEGER,
	"Y" DOUBLE
);
INSERT INTO PAL_MULTIVARSTAT_DATA_TBL VALUES (1,2.4);
INSERT INTO PAL_MULTIVARSTAT_DATA_TBL VALUES (5,3.5);
INSERT INTO PAL_MULTIVARSTAT_DATA_TBL VALUES (3,8.9);
INSERT INTO PAL_MULTIVARSTAT_DATA_TBL VALUES (10,-1.4);
INSERT INTO PAL_MULTIVARSTAT_DATA_TBL VALUES (-4,-3.5);
INSERT INTO PAL_MULTIVARSTAT_DATA_TBL VALUES (11,32.8);	

DROP TABLE #PAL_PARAMETER_TBL;
CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_PARAMETER_TBL (
    "PARAM_NAME" VARCHAR (256),
    "INT_VALUE" INTEGER,
    "DOUBLE_VALUE" DOUBLE,
    "STRING_VALUE" VARCHAR (1000)
);
INSERT INTO #PAL_PARAMETER_TBL VALUES ('RESULT_TYPE',0,null,null); //default value is 0, it can be {0,1}

CALL "_SYS_AFL"."PAL_MULTIVARIATE_ANALYSIS"(PAL_MULTIVARSTAT_DATA_TBL, #PAL_PARAMETER_TBL, ?);

