Documentation Center

  • Trial Software
  • Product Updates

todaily

Convert to daily

Syntax

newfts = todaily(oldfts)
newfts = todaily(oldfts, 'ParameterName', ParameterValue, ...)

Arguments

oldfts

Financial time series object

Description

newfts = todaily(oldfts) converts a financial time series of any frequency to a daily frequency. todaily uses holidays.m to determine valid trading days.

    Note   If oldfts contains time-of-day information, newfts displays the time-of-day as '00:00' for those days that did not previously exist in oldfts.

    Empty ([ ]) passed as inputs for parameter pair values for todaily will trigger the use of the defaults.

newfts = todaily(oldfts, 'ParameterName', ParameterValue, ...) accepts parameter name/parameter value pairs as input, as specified in the following table.

Parameter Name

Parameter Value

Description

CalcMethod

Exact

Returns the value located at specific dates/times. No data manipulation occurs.

v21x

This mode is compatible with previous versions of this function (Version 2.1.x and earlier). It returns a five-day business week that starts on Monday and ends on Friday.

    Note   If you set CalcMethod to v21x, settings for all of the following parameter name/parameter value pairs are not supported.

BusDays

0

Generates a financial time series that ranges from (or between) the first date to the last date in oldfts (includes NYSE nonbusiness days and holidays).

1

(Default) Generates a daily financial time series that ranges from the first date to the last date in oldfts (excludes NYSE nonbusiness days and holidays and weekends based on AltHolidays and Weekend).

NYSE market closures, holidays, and weekends are observed if AltHolidays and Weekend are not supplied or empty ([]).

DateFilter

Absolute

(Default) Displays all daily dates between the start and end dates of oldfts. Some dates may be disregarded if BusDays = 1.

    Note:   The default is to create a time series with every date at the specified periodicity, which is with DateFilter = Absolute. If you use DateFilter = Relative, the endpoint effects do not apply since only your data defines which dates will appear in the output time series object.

Relative

Displays only dates that exist in oldfts. Some dates may be disregarded if BusDays = 1.

TimeSpec

First

Returns only the observation that occurs at the first (earliest) time for a specific date.

Last

(Default) Returns only the observation that occurs at the last (latest) time for a specific date.

AltHolidays

Vector of dates specifying an alternate set of market closure dates.

-1

Excludes all holidays.

Weekend

Vector of length 7 containing 0's and 1's. The value 1 indicates a weekend day. The first element of this vector corresponds to Sunday. For example, when Saturday and Sunday are weekend days (default) then Weekend = [1 0 0 0 0 0 1].

Examples

expand all

Transform Time Series Object from Weekly to Daily Values

Load the data from the file predict_ret_data.mat and use the fints function to create a time series object with a weekly frequency.

load predict_ret_data.mat
x0 = fints(expdates, expdata, {'Metric'}, 'w', 'Index')
 
x0 = 
 
    desc:  Index
    freq:  Weekly (2)

    'dates:  (53)'    'Metric:  (53)'
    '01-Jan-1999'     [      97.8872]
    '08-Jan-1999'     [      97.0847]
    '15-Jan-1999'     [     109.6312]
    '22-Jan-1999'     [     105.5743]
    '29-Jan-1999'     [     108.4028]
    '05-Feb-1999'     [     134.4882]
    '12-Feb-1999'     [     117.5581]
    '19-Feb-1999'     [     106.6683]
    '26-Feb-1999'     [     118.2912]
    '05-Mar-1999'     [     105.6835]
    '12-Mar-1999'     [     128.5836]
    '19-Mar-1999'     [     115.1746]
    '26-Mar-1999'     [     131.2854]
    '02-Apr-1999'     [     130.7116]
    '09-Apr-1999'     [     123.1684]
    '16-Apr-1999'     [     107.2975]
    '23-Apr-1999'     [      91.5625]
    '30-Apr-1999'     [      78.5738]
    '07-May-1999'     [      65.2904]
    '14-May-1999'     [      70.8581]
    '21-May-1999'     [      72.4807]
    '28-May-1999'     [      72.9190]
    '04-Jun-1999'     [      64.3460]
    '11-Jun-1999'     [      59.8743]
    '18-Jun-1999'     [      55.0026]
    '25-Jun-1999'     [      49.4032]
    '02-Jul-1999'     [      49.9485]
    '09-Jul-1999'     [      47.8061]
    '16-Jul-1999'     [      61.0517]
    '23-Jul-1999'     [      58.9313]
    '30-Jul-1999'     [      53.9584]
    '06-Aug-1999'     [      44.8472]
    '13-Aug-1999'     [      45.0463]
    '20-Aug-1999'     [      45.1088]
    '27-Aug-1999'     [      56.4897]
    '03-Sep-1999'     [      61.2449]
    '10-Sep-1999'     [      58.1012]
    '17-Sep-1999'     [      50.8974]
    '24-Sep-1999'     [      46.5143]
    '01-Oct-1999'     [      38.0806]
    '08-Oct-1999'     [      33.6664]
    '15-Oct-1999'     [      34.2992]
    '22-Oct-1999'     [      33.4202]
    '29-Oct-1999'     [      36.9287]
    '05-Nov-1999'     [      35.1278]
    '12-Nov-1999'     [      41.8128]
    '19-Nov-1999'     [      35.8199]
    '26-Nov-1999'     [      36.9495]
    '03-Dec-1999'     [      36.2880]
    '10-Dec-1999'     [      33.8457]
    '17-Dec-1999'     [      33.3868]
    '24-Dec-1999'     [      32.7737]
    '31-Dec-1999'     [      28.5665]

Use todaily to obtain the daily aggregate for the x0 times series.

x1 = todaily(x0)
 
x1 = 
 
    desc:  TODAILY: Index
    freq:  Daily (1)

    'dates:  (252)'    'Metric:  (252)'
    '04-Jan-1999'      [           NaN]
    '05-Jan-1999'      [           NaN]
    '06-Jan-1999'      [           NaN]
    '07-Jan-1999'      [           NaN]
    '08-Jan-1999'      [       97.0847]
    '11-Jan-1999'      [           NaN]
    '12-Jan-1999'      [           NaN]
    '13-Jan-1999'      [           NaN]
    '14-Jan-1999'      [           NaN]
    '15-Jan-1999'      [      109.6312]
    '19-Jan-1999'      [           NaN]
    '20-Jan-1999'      [           NaN]
    '21-Jan-1999'      [           NaN]
    '22-Jan-1999'      [      105.5743]
    '25-Jan-1999'      [           NaN]
    '26-Jan-1999'      [           NaN]
    '27-Jan-1999'      [           NaN]
    '28-Jan-1999'      [           NaN]
    '29-Jan-1999'      [      108.4028]
    '01-Feb-1999'      [           NaN]
    '02-Feb-1999'      [           NaN]
    '03-Feb-1999'      [           NaN]
    '04-Feb-1999'      [           NaN]
    '05-Feb-1999'      [      134.4882]
    '08-Feb-1999'      [           NaN]
    '09-Feb-1999'      [           NaN]
    '10-Feb-1999'      [           NaN]
    '11-Feb-1999'      [           NaN]
    '12-Feb-1999'      [      117.5581]
    '16-Feb-1999'      [           NaN]
    '17-Feb-1999'      [           NaN]
    '18-Feb-1999'      [           NaN]
    '19-Feb-1999'      [      106.6683]
    '22-Feb-1999'      [           NaN]
    '23-Feb-1999'      [           NaN]
    '24-Feb-1999'      [           NaN]
    '25-Feb-1999'      [           NaN]
    '26-Feb-1999'      [      118.2912]
    '01-Mar-1999'      [           NaN]
    '02-Mar-1999'      [           NaN]
    '03-Mar-1999'      [           NaN]
    '04-Mar-1999'      [           NaN]
    '05-Mar-1999'      [      105.6835]
    '08-Mar-1999'      [           NaN]
    '09-Mar-1999'      [           NaN]
    '10-Mar-1999'      [           NaN]
    '11-Mar-1999'      [           NaN]
    '12-Mar-1999'      [      128.5836]
    '15-Mar-1999'      [           NaN]
    '16-Mar-1999'      [           NaN]
    '17-Mar-1999'      [           NaN]
    '18-Mar-1999'      [           NaN]
    '19-Mar-1999'      [      115.1746]
    '22-Mar-1999'      [           NaN]
    '23-Mar-1999'      [           NaN]
    '24-Mar-1999'      [           NaN]
    '25-Mar-1999'      [           NaN]
    '26-Mar-1999'      [      131.2854]
    '29-Mar-1999'      [           NaN]
    '30-Mar-1999'      [           NaN]
    '31-Mar-1999'      [           NaN]
    '01-Apr-1999'      [           NaN]
    '05-Apr-1999'      [           NaN]
    '06-Apr-1999'      [           NaN]
    '07-Apr-1999'      [           NaN]
    '08-Apr-1999'      [           NaN]
    '09-Apr-1999'      [      123.1684]
    '12-Apr-1999'      [           NaN]
    '13-Apr-1999'      [           NaN]
    '14-Apr-1999'      [           NaN]
    '15-Apr-1999'      [           NaN]
    '16-Apr-1999'      [      107.2975]
    '19-Apr-1999'      [           NaN]
    '20-Apr-1999'      [           NaN]
    '21-Apr-1999'      [           NaN]
    '22-Apr-1999'      [           NaN]
    '23-Apr-1999'      [       91.5625]
    '26-Apr-1999'      [           NaN]
    '27-Apr-1999'      [           NaN]
    '28-Apr-1999'      [           NaN]
    '29-Apr-1999'      [           NaN]
    '30-Apr-1999'      [       78.5738]
    '03-May-1999'      [           NaN]
    '04-May-1999'      [           NaN]
    '05-May-1999'      [           NaN]
    '06-May-1999'      [           NaN]
    '07-May-1999'      [       65.2904]
    '10-May-1999'      [           NaN]
    '11-May-1999'      [           NaN]
    '12-May-1999'      [           NaN]
    '13-May-1999'      [           NaN]
    '14-May-1999'      [       70.8581]
    '17-May-1999'      [           NaN]
    '18-May-1999'      [           NaN]
    '19-May-1999'      [           NaN]
    '20-May-1999'      [           NaN]
    '21-May-1999'      [       72.4807]
    '24-May-1999'      [           NaN]
    '25-May-1999'      [           NaN]
    '26-May-1999'      [           NaN]
    '27-May-1999'      [           NaN]
    '28-May-1999'      [       72.9190]
    '01-Jun-1999'      [           NaN]
    '02-Jun-1999'      [           NaN]
    '03-Jun-1999'      [           NaN]
    '04-Jun-1999'      [       64.3460]
    '07-Jun-1999'      [           NaN]
    '08-Jun-1999'      [           NaN]
    '09-Jun-1999'      [           NaN]
    '10-Jun-1999'      [           NaN]
    '11-Jun-1999'      [       59.8743]
    '14-Jun-1999'      [           NaN]
    '15-Jun-1999'      [           NaN]
    '16-Jun-1999'      [           NaN]
    '17-Jun-1999'      [           NaN]
    '18-Jun-1999'      [       55.0026]
    '21-Jun-1999'      [           NaN]
    '22-Jun-1999'      [           NaN]
    '23-Jun-1999'      [           NaN]
    '24-Jun-1999'      [           NaN]
    '25-Jun-1999'      [       49.4032]
    '28-Jun-1999'      [           NaN]
    '29-Jun-1999'      [           NaN]
    '30-Jun-1999'      [           NaN]
    '01-Jul-1999'      [           NaN]
    '02-Jul-1999'      [       49.9485]
    '06-Jul-1999'      [           NaN]
    '07-Jul-1999'      [           NaN]
    '08-Jul-1999'      [           NaN]
    '09-Jul-1999'      [       47.8061]
    '12-Jul-1999'      [           NaN]
    '13-Jul-1999'      [           NaN]
    '14-Jul-1999'      [           NaN]
    '15-Jul-1999'      [           NaN]
    '16-Jul-1999'      [       61.0517]
    '19-Jul-1999'      [           NaN]
    '20-Jul-1999'      [           NaN]
    '21-Jul-1999'      [           NaN]
    '22-Jul-1999'      [           NaN]
    '23-Jul-1999'      [       58.9313]
    '26-Jul-1999'      [           NaN]
    '27-Jul-1999'      [           NaN]
    '28-Jul-1999'      [           NaN]
    '29-Jul-1999'      [           NaN]
    '30-Jul-1999'      [       53.9584]
    '02-Aug-1999'      [           NaN]
    '03-Aug-1999'      [           NaN]
    '04-Aug-1999'      [           NaN]
    '05-Aug-1999'      [           NaN]
    '06-Aug-1999'      [       44.8472]
    '09-Aug-1999'      [           NaN]
    '10-Aug-1999'      [           NaN]
    '11-Aug-1999'      [           NaN]
    '12-Aug-1999'      [           NaN]
    '13-Aug-1999'      [       45.0463]
    '16-Aug-1999'      [           NaN]
    '17-Aug-1999'      [           NaN]
    '18-Aug-1999'      [           NaN]
    '19-Aug-1999'      [           NaN]
    '20-Aug-1999'      [       45.1088]
    '23-Aug-1999'      [           NaN]
    '24-Aug-1999'      [           NaN]
    '25-Aug-1999'      [           NaN]
    '26-Aug-1999'      [           NaN]
    '27-Aug-1999'      [       56.4897]
    '30-Aug-1999'      [           NaN]
    '31-Aug-1999'      [           NaN]
    '01-Sep-1999'      [           NaN]
    '02-Sep-1999'      [           NaN]
    '03-Sep-1999'      [       61.2449]
    '07-Sep-1999'      [           NaN]
    '08-Sep-1999'      [           NaN]
    '09-Sep-1999'      [           NaN]
    '10-Sep-1999'      [       58.1012]
    '13-Sep-1999'      [           NaN]
    '14-Sep-1999'      [           NaN]
    '15-Sep-1999'      [           NaN]
    '16-Sep-1999'      [           NaN]
    '17-Sep-1999'      [       50.8974]
    '20-Sep-1999'      [           NaN]
    '21-Sep-1999'      [           NaN]
    '22-Sep-1999'      [           NaN]
    '23-Sep-1999'      [           NaN]
    '24-Sep-1999'      [       46.5143]
    '27-Sep-1999'      [           NaN]
    '28-Sep-1999'      [           NaN]
    '29-Sep-1999'      [           NaN]
    '30-Sep-1999'      [           NaN]
    '01-Oct-1999'      [       38.0806]
    '04-Oct-1999'      [           NaN]
    '05-Oct-1999'      [           NaN]
    '06-Oct-1999'      [           NaN]
    '07-Oct-1999'      [           NaN]
    '08-Oct-1999'      [       33.6664]
    '11-Oct-1999'      [           NaN]
    '12-Oct-1999'      [           NaN]
    '13-Oct-1999'      [           NaN]
    '14-Oct-1999'      [           NaN]
    '15-Oct-1999'      [       34.2992]
    '18-Oct-1999'      [           NaN]
    '19-Oct-1999'      [           NaN]
    '20-Oct-1999'      [           NaN]
    '21-Oct-1999'      [           NaN]
    '22-Oct-1999'      [       33.4202]
    '25-Oct-1999'      [           NaN]
    '26-Oct-1999'      [           NaN]
    '27-Oct-1999'      [           NaN]
    '28-Oct-1999'      [           NaN]
    '29-Oct-1999'      [       36.9287]
    '01-Nov-1999'      [           NaN]
    '02-Nov-1999'      [           NaN]
    '03-Nov-1999'      [           NaN]
    '04-Nov-1999'      [           NaN]
    '05-Nov-1999'      [       35.1278]
    '08-Nov-1999'      [           NaN]
    '09-Nov-1999'      [           NaN]
    '10-Nov-1999'      [           NaN]
    '11-Nov-1999'      [           NaN]
    '12-Nov-1999'      [       41.8128]
    '15-Nov-1999'      [           NaN]
    '16-Nov-1999'      [           NaN]
    '17-Nov-1999'      [           NaN]
    '18-Nov-1999'      [           NaN]
    '19-Nov-1999'      [       35.8199]
    '22-Nov-1999'      [           NaN]
    '23-Nov-1999'      [           NaN]
    '24-Nov-1999'      [           NaN]
    '26-Nov-1999'      [       36.9495]
    '29-Nov-1999'      [           NaN]
    '30-Nov-1999'      [           NaN]
    '01-Dec-1999'      [           NaN]
    '02-Dec-1999'      [           NaN]
    '03-Dec-1999'      [       36.2880]
    '06-Dec-1999'      [           NaN]
    '07-Dec-1999'      [           NaN]
    '08-Dec-1999'      [           NaN]
    '09-Dec-1999'      [           NaN]
    '10-Dec-1999'      [       33.8457]
    '13-Dec-1999'      [           NaN]
    '14-Dec-1999'      [           NaN]
    '15-Dec-1999'      [           NaN]
    '16-Dec-1999'      [           NaN]
    '17-Dec-1999'      [       33.3868]
    '20-Dec-1999'      [           NaN]
    '21-Dec-1999'      [           NaN]
    '22-Dec-1999'      [           NaN]
    '23-Dec-1999'      [           NaN]
    '27-Dec-1999'      [           NaN]
    '28-Dec-1999'      [           NaN]
    '29-Dec-1999'      [           NaN]
    '30-Dec-1999'      [           NaN]
    '31-Dec-1999'      [       28.5665]

See Also

| | | | | |

Was this topic helpful?