Calculates Laspeyred chained indexes
ind_agreg=chained_Laspeyres(indexes,weights,base)
* indexes = a string matrix, collecting the names of the ts that will be aggregated, with high frequency
* weights = a string matrix, collecting the names of the ts of the corresponding weights, with low frequency
* base = a number, the base year of the series
* ind_agreg = a ts, the result of the aggregation
// load the data on French CPI global GROCERDIR ; load(GROCERDIR+'data\fra_cpi.dat') // calculate the food CPI incdes as the aggregate of unprocessed food and processed food fra_cpi_food2=chained_Laspeyres(['fra_cpi_unprocfood','fra_cpi_procfood'],... ['fra_cpi_w_unprocfood','fra_cpi_w_procfood'],2015) // compare the result with the true index (note that because Insee pubslishes only rounded figures // there amy be small differences between the 2 series) write(%io(2),'error in % between the reconstructed and true food cpi') disp(100*(fra_cpi_food2/fra_cpi_food-1)) | ![]() | ![]() |