Cumulative Product
This function returns the cumulative product of the elements of the input array or time series. The result is an object of the same class of the input, and its elements are the cumulative product of the current and the previous elements of the input.
If the input is a time series, users can provide the argument TSRANGE
in order to project the input time series before the cumulative product.
CUMPROD(x=NULL, TSRANGE=NULL, avoidCompliance=FALSE, ...)
x |
Input numerical array or time series that must satisfy the compliance control check defined in |
TSRANGE |
Optional date range of operations that process the input time series. |
avoidCompliance |
If |
... |
Backward compatibility. |
This function returns an object of the same class of the input, i.e. an array or a BIMETS time series.
#create ts ts1=TSERIES(INTS(1,10),START=c(2000,1),FREQ='M') out_CUMPROD=CUMPROD(ts1) TABIT(out_CUMPROD) out_CUMPROD=CUMPROD(ts1,TSRANGE=c(2000,4,2001,1)) TABIT(ts1,out_CUMPROD) #define an array arr1=c(INTS(1,5),INTS(-1,-5)) out_CUMPROD=CUMPROD(arr1) print(out_CUMPROD)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.