ChartDirector Ver 3.1 (PHP Edition Edition)

ArrayMath.movCorr


Usage

movCorr(interval[, b ])

Description

Replace each element of the ArrayMath object by the moving correlation with another array or with itself.

The interval parameter specifies the window size for computing moving correlation. The moving correlation is computed as the correlation coefficient between the ArrayMath object and the other array, where only the current element and the previous (interval - 1) elements are considered in the computation.

If the other array is not provided, it is assumed to be the sequence of numbers 0, 1, 2, 3, 4.... This is equaivalent to checking if the elements of the ArrayMath object is linear.

No moving correlation can be computed for the first (interval - 1) elements, because there is insufficient previous elements. So the first (interval - 1) elements will be replaced with NoValue.

Arguments

ArgumentDefaultDescription
interval(Mandatory)The window size.
b[Empty_Array]The array to be correlated with the ArrayMath object. If this argument is an empty array, the sequence of numbers 0, 1, 2, 3, 4 .... will be used instead.

Return Value

The current ArrayMath object.


th> smoothness0.25The smoothness factor. It must be between 0 - 1. It is the portion of points used in finding the n nearest points. In other words, n = smoothness * no_of_points. A larger value will result in a smoother the curve. A smaller value will result in the curve tracking the data points better.

For LOWESS to have any smoothing effect at all, n must be at least 3. You may need to use a large smoothness factor if you only have a few data points.iteration0The number of additional iteration used in the LOWESS algorithm. Unless your data is extremely noisy, in most case no additional iteration is necessary.

Return Value

The current ArrayMath object.


checking if the elements of the given decisionArray is less than or equal to zero.selectEQZ(Self)Select the elements of the ArrayMath object by checking if the elements of the given decisionArray is equal to zero.selectNEZ(Self)Select the elements of the ArrayMath object by checking if the elements of the given decisionArray is not equal to zero.selectStartOfHour(Self)Select the elements of the ArrayMath object that represents a different hour from the previous element.selectStartOfDay(Self)Select the elements of the ArrayMath object that represents a different day from the previous element.selectStartOfWeek(Self)Select the elements of the ArrayMath object that represents a different week from the previous element.selectStartOfMonth(Self)Select the elements of the ArrayMath object that represents a different month from the previous element.selectStartOfYear(Self)Select the elements of the ArrayMath object that represents a different year from the previous element.trim(Self)Trim the ArrayMath object by keeping only some elements in the middle.insert(Self)Insert the elements of an array to the ArrayMath object.insert2(Self)Insert some constant elements to the ArrayMath object.replace(Self)Find elements that are equal to a given value and replace it with another value.movAvg(Self)Replace each element of the ArrayMath object by its moving average.expAvg(Self)Replace each element of the ArrayMath object by its exponential average.movMed(Self)Replace each element of the ArrayMath object by its moving median.movPercentile(Self)Replace each element of the ArrayMath object by its moving percentile.movMax(Self)Replace each element of the ArrayMath object by its moving maximum.movMin(Self)Replace each element of the ArrayMath object by its moving minimum.movStdDev(Self)Replace each element of the ArrayMath object by its moving standard deviation.movCorr(Self)Replace each element of the ArrayMath object by the moving correlation with another array or with itself.lowess(Self)Fit a curve through the data points in the ArrayMath object using the LOWESS algorithm.lowess2(Self)Fit a curve through the data points in the ArrayMath object using the LOWESS algorithm, where the spacing of the data points is supplied by the given array.result(Self)Get the content of the ArrayMath object as a normal array to be used in other ChartDirector API.max(Self)Get the maximum value of the elements of the ArrayMath object.min(Self)Get the minimum value of the elements of the ArrayMath object.avg(Self)Get the average value of the elements of the ArrayMath object.sum(Self)Get the total value of the elements of the ArrayMath object.med(Self)Get the median value of the elements of the ArrayMath object.percentile(Self)Get the required percentile value of the elements of the ArrayMath object.maxIndex(Self)Get the index of the maximum value element of the ArrayMath object.minIndex(Self)Get the index of the minimum value element of the ArrayMath object.
(1059, '1999-03-01', '371', '635', '722');