Skip to Content
Think Stats 第3版 ―Pythonで学ぶ統計学入門
book

Think Stats 第3版 ―Pythonで学ぶ統計学入門

by Allen B. Downey, 大橋 真也
October 2025
Intermediate to advanced
328 pages
3h 56m
Japanese
O'Reilly Japan, Inc.
Content preview from Think Stats 第3版 ―Pythonで学ぶ統計学入門

12章時系列分析

時系列とは、時間とともに変化するシステムから得られる測定値のシーケンスです。11章で使った回帰のようなツールの多くは、時系列でも使えます。しかし、この種のデータに特に有用な別な分析手法もあります。

例として、2001年から2024年までの米国の再生可能エネルギー発電量データと、同じ期間の気象データという2つのデータセットを取り上げます。時系列を長期トレンドと繰り返される季節変動成分に分解する手法を行い、線形回帰モデルを用いて、トレンドの推定と予測を行います。また、時系列データを分析するために広く使われているモデルである「自己回帰和分移動平均(ARIMA:autoregressive integrated moving average)」モデルを実際に試します。

12.1 電力

時系列データの例として、米国エネルギー情報局(US Energy Information Administration)のデータセットを使用します。このデータセットには、2001年から2024年までの再生可能エネルギーによる月別総発電量が含まれています。データのダウンロード方法はこの章のノートブックで説明しています。

データを読み込んだ後、それを作業しやすい形式に変換する必要があります。

elec = (
    pd.read_csv("Net_generation_for_all_sectors.csv", skiprows=4)
    .drop(columns=["units", "source key"])
    .set_index("description")
    .replace("--", np.nan)
    .transpose()
    .astype(float)
)

再フォーマットされたデータセットでは、各行が各月次を表し、各列は供給源別のギガワット時(GWh)単位の月次総量のシーケンスです。以下は列のラベルで、異なる電力の供給源「セクター」を示しています。 ...

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

SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム

SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム

Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, Sky株式会社 玉川 竜司
MLOps実装ガイド ―本番運用を見据えた開発戦略

MLOps実装ガイド ―本番運用を見据えた開発戦略

Yaron Haviv, Noah Gift, 井伊 篤彦, 入江 美穂, 張 凡, 樋口 千洋

Publisher Resources

ISBN: 9784814401376Publisher Website