以时间序列插值循环数据

时间:2015-10-26 18:07:23

标签: r time-series interpolation missing-data

我有一个关于风向的低频时间序列数据,源于每天三次测量(06,12和18)。我想在高频系列温度上匹配这个时间序列,对缺失值应用任何类型的圆弧插值。有人能指出我正确的方向如何实现这个目标吗?

下面的代码会生成一些示例数据。

# create high-freq time series of temperature data

zw1 <- textConnection("datetime, temperature
01.01.2015 00:00, 1.1
01.01.2015 02:00, 0.8
01.01.2015 04:00, 0.7
01.01.2015 06:00, 0.5
01.01.2015 08:00, 0.2
01.01.2015 10:00, 0.6
01.01.2015 12:00, 2.3
01.01.2015 14:00, 2.7
01.01.2015 16:00, 2.4
01.01.2015 18:00, 1.5
01.01.2015 20:00, 0.4
01.01.2015 22:00, -0.5
02.01.2015 00:00, -0.8")

temps <- read.csv(zw1)

temps$datetime <- as.POSIXct(temps$datetime, format="%d.%m.%Y %H:%M")

# create low-freq time series of wind direction (circular data) to be interpolated
# onto the temperature data time series

zw2 <- textConnection("datetime, wind.direction
01.01.2015 06:00, 273
01.01.2015 12:00, 195
01.01.2015 18:00, 182
02.01.2015 06:00, 171")

wind <- read.csv(zw2)

wind$datetime <- as.POSIXct(wind$datetime, format="%d.%m.%Y %H:%M")

0 个答案:

没有答案