<< bsoption Financial module duration >>

Financial module >> Financial module > cfr

cfr

compare two or more time series of data and eliminate the elements which do not have the same date

SYNOPSIS

[S]=cfr(S1,S2[,S3,S4,...]);

Description

Compare time series and make them homogeneous with respect to the dates (by eliminating the elements which do not have the same date)

Parameters

S1

two column matrix: the first column must be a list of dates, while the second column must contain data

S2

two column matrix: the first column must be a list of dates, while the second column must contain data

S3, S4,...
any other two-column matrix as the previous ones

Output

S
a matrix whose first column contains the dates, while the other columns contain the series of data

Example

First we create two time series with the following commands

-->S1=[datenum(2010*ones(10,1),ones(10,1),[1:10]') [1:10]']

S1 = 734139. 1.

734140. 2.

734141. 3.

734142. 4.

734143. 5.

734144. 6.

734145. 7.

734146. 8.

734147. 9.

734148. 10.

-->S2=[datenum(2010*ones(5,1),ones(5,1),[1:2:10]') [1:2:10]'*5+4]

S2 = 734139. 9.

734141. 19.

734143. 29.

734145. 39.

734147. 49.

Then we use the function for selecting, from these time series, only the data which compare in both of them

-->S=cfr(S1,S2)

S = 734139. 1. 9.

734141. 3. 19.

734143. 5. 29.

734145. 7. 39.

734147. 9. 49.

Authors

Francesco Menoncin - Brescia University - 2010

See Also


<< bsoption Financial module duration >>