QUARTERLY {bimets}R Documentation

Quarterly (Dis)Aggregation

Description

This function returns a quarterly (dis)aggregated time series, using as input an annual, semiannual, monthly or daily time series.

Usage

QUARTERLY(x = NULL, fun = NULL, avoidCompliance = FALSE, ...)

Arguments

x

Input time series that must satisfy the compliance control check defined in is.bimets.

fun

Only for daily or monthly input time series:
STOCK: the value of the input time series in the last observation of a quarter is assigned to the same quarter of the output time series.
NSTOCK: the value of the input time series in the last non-missing observation of a quarter is assigned to the same quarter of the output time series.
SUM: the sum of input observations in a quarter is assigned to the same quarter of the output time series.
NSUM: the sum of input non-missing observations in a quarter is assigned to the same quarter of the output time series.
AVE: the average of input observations in a quarter is assigned to the same quarter of the output time series.
NAVE: the average of input non-missing observations in a quarter is assigned to the same quarter of the output time series.

Only for semiannual or annual input time series:
NULL: (default) the output value of each quarterly observation is set equal to the value of the input observation the quarter belongs to (i.e. duplicated values over the period)
INTERP_END: the value of the input time series in a period is copied into the last quarter of the output time series that lies in the same period. Other values are calculated by linear interpolation.
INTERP_CENTER: the value of the input time series in a period is copied into the median quarter of the output time series that lies in the same period. Other values are calculated by linear interpolation.
INTERP_BEGIN: the value of the input time series in a period is copied into the first quarter of the output time series that lies in the same period. Other values are calculated by linear interpolation.

avoidCompliance

If TRUE, compliance control check of input time series will be skipped. See is.bimets

...

Backward compatibility.

Value

This function returns a quarterly BIMETS time series.

See Also

YEARLY
SEMIANNUAL
MONTHLY
DAILY

Examples


	#TS YEARLY TO QUARTERLY
	n=10
	ts1=TSERIES(1:n,START=c(2000,1),FREQ=1)
	ts1[5]=NA
	TABIT(QUARTERLY(ts1,fun='INTERP_CENTER'));
	
	#TS DAILY TO QUARTERLY
	n=600
	ts1=TSERIES(1:n,START=c(2000,1),FREQ='D')
	ts1[25]=NA
	TABIT(QUARTERLY(ts1,fun='SUM'))

[Package bimets version 1.5.3 Index]