簡體   English   中英

如何使用 R 實現此類時間序列的平穩性?

[英]How to achieve stationarity for this type of time series using R?

這在我看來有一個指數趨勢,但我不完全確定如何解決這個問題。

時間序列

使用預測 package:

library(forecast)
no_diffs_to_stationary = ndiffs(df$px)
df$stationary_series <- c(rep(NA, no_diffs_to_stationary),
                          diff(df$px, no_diffs_to_stationary))
mean(df$stationary_series, na.rm = TRUE)
sd(df$stationary_series, na.rm = TRUE)

數據:

x <- seq(0, 20, length.out=1000)
df <- data.frame(x = x, px = dexp(x, rate=0.65))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM