数据预处理
金融市场的日期和货币数据
在运行分析之前,数据的表示形式和质量至关重要。通常需要将金融数据的格式转换为标准格式。此工具箱提供了一组工具来整理和转换金融数据以进行分析。
函数
日期和时间分量格式
now | 当前日期和时间作为日期序列值 |
today | 当前日期 |
datefind | Indices of dates in matrix |
datevec | 将日期和时间转换为分量向量 |
datetime | 表示时间点的数组 |
day | 月中第几天 |
eomdate | (Not recommended; use dateshift ) Last date of
month |
hour | |
lweekdate | Date of last occurrence of weekday in month |
second | 日期或时间的秒数 |
minute | |
month | 日期的月份 |
months | (Not recommended; use between ) Number of whole months between
dates |
nweekdate | Date of specific occurrence of weekday in month |
weeknum | (Not recommended; use week ) Week in year |
year | 日期年份 |
yeardays | Number of days in year |
日期转换
工作日
busdate | Next or previous business day |
busdays | Business days for given period |
datemnth | Date of day in future or past month |
datewrkdy | Date of future or past workday |
days252bus | Number of business days between dates |
days360 | Days between dates based on 360-day year |
days360e | Days between dates based on 360-day year (European) |
days360isda | Days between dates based on 360-day year (International Swap Dealer Association (ISDA) compliant) |
days360psa | Days between dates based on 360-day year (Public Securities Association (PSA) compliant) |
days365 | 基于一年 365 天的日期之间的天数 |
daysact | 日期之间的实际天数 |
daysadd | Date away from starting date for any day-count basis |
daysdif | Days between dates for any for any day-count basis |
fbusdate | First business date of month |
isbusday | True for dates that are business days |
lbusdate | Last business date of month |
quarter | |
thirdwednesday | Find third Wednesday of month |
wrkdydif | Number of working days between dates |
yearfrac | 计算日期之间的天数占全年的比例 |
交易日历
createholidays | Create trading calendars |
holidays | Holidays and nontrading days |
nyseclosures | New York Stock Exchange closures from 1885 to 2070 |
addBusinessCalendar | Add business calendar awareness to timetables |
息票债券日期
accrfrac | 应计天数占付息周期的比例 |
cpncount | Coupon payments remaining until maturity |
cpndaten | Next coupon date for fixed-income security |
cpndatenq | Next quasi-coupon date for fixed-income security |
cpndatepq | Previous quasi-coupon date for fixed-income security |
cpndatep | Previous coupon date for fixed-income security |
cpndaysn | Number of days to next coupon date |
cpndaysp | Number of days since previous coupon date |
cpnpersz | Number of days in coupon period |
货币和价格转换
cur2frac | Decimal currency values to fractional values |
cur2str | 银行格式文本 |
dec2thirtytwo | Decimal to thirty-second quotation |
frac2cur | Fractional currency value to decimal value |
thirtytwo2dec | Thirty-second quotation to decimal |
主题
- 处理和转换日期
处理和转换日期字符向量和日期序列值、节假日和现金流日期。
- Trading Calendars User Interface
Using the Trading Calendars user interface to manage holidays.
- UICalendar User Interface
Using
uicalendar
to manage dates.
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)