Skip to Content
R Cookbook
book

R Cookbook

by JD Long, Paul Titer, Jee -Won Lee
May 2022
Beginner to intermediate
667 pages
16h 17m
Korean
Insight
Content preview from R Cookbook
R
532
14장 시계열 분석
14.16
󺤟󽴔󻞫󺆓󻫃󽴔󻕻󻱃󻰧󽴔󻞫󼃷󻖐󺇏󽴔󼄍󻨓󺖃󺋿
󻀇󻳫
두 시계열 사이에 시차가 있는 상관관계가 있는지 궁금하다.
󼩃󺅿󼄔
forecast
패키지의
Ccf
함수를 사용해서 시차가 있는 상관관계를 드러내 보여 줄 교
차상관 함수를 그린다.
library(forecast)
Ccf(
ts1
,
ts2
)
󺙋󻰧
교차상관 함수는 두 시계열 사이의 시차상관을 발견할 수 있도록 도와준다. ‘시차상
관(
lagged
correlation
)’은 한 시계열에 있는 오늘의 값이 다른 시계열의 과거 또는
미래의 값과 상관관계가 있을 때 발생한다.
원자재 가격과 채권 가격 사이의 관계를 생각해 보자. 일부 애널리스트들은 원자
재 가격 변화가 인플레이션의 지표이며, 채권 가격은 인플레이션에 영향을 받기 때
문에 이들 사이에 관계가 있다고 믿는다. 우리가 이들 사이의 상관관계를 밝혀낼 수
있을까?
그림
14
-
9
에 일일 채권 가격의 변화량과 원자재 가격 인덱스로부터 생성된 교차상
관 함수가 있다.
1
library(forecast)
load(file = "./data/bnd
_
cmty.Rdata")
b <- coredata(bonds)[, 1]
c <- coredata(cmdtys)[, 1]
Ccf(b, c, main = "Bonds vs. Commodities")
1
더 자세히는,
bonds
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

R Cookbook

R Cookbook

Paul Teetor
R Graphics Cookbook

R Graphics Cookbook

Winston Chang
R Cookbook, 2nd Edition

R Cookbook, 2nd Edition

JD Long, Paul Teetor

Publisher Resources

ISBN: 9788966262984