Skip to Content
Python算法交易
book

Python算法交易

by Yves Hilpisch
November 2022
Intermediate to advanced
392 pages
10h 8m
Chinese
China Electric Power Press Ltd.
Content preview from Python算法交易
通过机器学习预测市场动向
|
147
图 5-2:基于线性回归的预测(外推)
5.1.2
价格预测的基本思路
基于时间序列数据的价格预测必须处理一项特殊功能:基于时间的数据排序。通常,
数据的排序对于线性回归的应用并不重要。在上一部分的第一个示例中,可以在完
全保持
x
和
y
对不变的情况下,以完全不同的顺序编译执行线性回归的数据。最优
回归参数将是相同的,与排序无关。
但是,例如在预测明天的指数指标水平时,以正确的顺序设置历史指数水平似乎至
关重要。如果是这种情况,则在给定今天,昨天,前一天等的指数水平的情况下,
人们将尝试预测明天的指数水平。通常将用作输入的天数称为滞后。因此,使用今
天的指数水平和之前的两个指数水平,会转化为三个滞后。
下一个示例将该想法再次投射到一个相当简单的上下文中。该示例使用的数据是从
0
~
11
的数字:
In [9]: x = np.arange(12)
In [10]: x
Out[10]: array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
148
|
第
5
章
假设回归存在三个滞后。这说明了回归的三个自变量和一个因变量。更具体地说,
0
、
1
和
2
是自变量的值,而
3
是因变量的相应值。继续前进(“按时间”),这些
值分别是
1
、
2
、
3
,以及
4
。这些值的最终组合是 ...
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

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
图解大模型 : 生成式AI 原理与实战

图解大模型 : 生成式AI 原理与实战

Jay Alammar, Maarten Grootendorst

Publisher Resources

ISBN: 9787519869694