我想从另一个时间序列构建一个时间序列,贴现旧的值。也就是说,最近的值通常包含在和中,以前的值用Δ^t贴现,然后添加一个新的值,这个值又通常包含在新的时间序列中,旧的值则用delta^t和delta^( the )贴现。整件事应该是这样的:
Data: df<- c(0.4387738, 0.05203873, 0.3238407, 0.1117364)
> test[[1]][["se_ne"]][[1]]
[1] 0.4387738
>
> test[[2]][["se_ne"]][[2]] + 0.4^(2-1)*test[[2]][["se_ne"]][[2-1]]
[1] 0.2275482
>
> test[[3]][["se_ne"]][[3]] + 0.4^(3-2)*test[[3]][["se_ne"]][[3-1]] + 0.4^(3-1)*test[[3]][["se_ne"]][[3-2]]
[1] 0.41486但是数据集有700多个观测数据,有比手工计算所有数据更聪明的解决方案吗?
谢谢你的反馈!
发布于 2022-03-08 17:15:39
https://stackoverflow.com/questions/71397022
复制相似问题