Skip to Content
R 语言经典实例(原书第 2 版)
book

R 语言经典实例(原书第 2 版)

by J.D. Long, Paul Teetor
June 2020
Beginner to intermediate
522 pages
9h 6m
Chinese
China Machine Press
Content preview from R 语言经典实例(原书第 2 版)
409
14
时间序列分析
随着量化金融和证券自动交易的兴起,时间序列分析已经成为一个热门话题。本章描述
的大部分内容都是金融、证券交易和投资组合管理方面的从业者和研究人员开发的。
在用 R 开始时间序列分析之前,一个关键的问题是选择数据的表示方式(即对象类)。
这在面向对象的语言(如 R)中尤其重要,因为数据表示方式的选择不仅仅影响数据的
存储方式,它还决定了哪些函数(或方法)可用于加载、处理、分析、输出和绘制数据。
当许多人开始使用 R 时,他们只是将时间序列数据存储在向量中。这似乎很自然。然
而,他们很快发现时间序列分析中功能强大的分析都不能用于简单的向量。我们发现,
当用户切换到专门用于时间序列数据的对象类时,分析变得更容易,这是应用 R 进行时
间序列分析的必经之路。
本章建议使用 zoo xts 包来表示时间序列数据。这两个包非常通用,能满足大多数
用户的需求。本章的几乎所有分析都假定你正在使用这两种时间序列的表示方式中的
一种。
xts 实现是 zoo 包的超集,因此 xts 可以实现 zoo 包的所有功能。在本章
中,除非另有说明,当 zoo 对象类能完成一项分析时,可以放心地应用 xts
对象类来完成分析。
其他表示方式
R 中提供了时间序列数据的其他表示,包括:
fts
来自 tseries 包的 irts
timeSeries
410
14
基本发布包中的 ts
tsibble 包,一个时间序列的 tidyverse
实际上,有一个完整的软件包,称为 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

Aurélien Géron
大规模数据分析和建模:基于 Spark 与 R

大规模数据分析和建模:基于 Spark 与 R

Javier Luraschi, Kevin Kuo, Edgar Ruiz
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111656814