tmbeta(T=1..25, Y=y_matrix, X=x_series,window=10):X must be a vector with the same length as T.

T = 1..25
X = 2..26
Y1 = 3..27
Y2 = 4..28
y_matrix = matrix(table(Y1 as y1, Y2 as y2))
y1_matrix=matrix(table(Y1 as y1, Y2 as y2))
x_series = indexedSeries(1..25,X)
tmbeta(T=1..25, Y=y_matrix[0], X=x_series[0],window=10)
请先 登录 后评论

1 个回答

Draco Chen

这里的X=x_series 必须是向量,而实际类型却是matrix。

由于y_matrix 是indexedMatrix,所以不需要tmbeta的T提供索引,可以改用mbeta

mbeta(X=x_series,Y=y_matrix,window=10)

用tmbeta,可以改为

y1_matrix=matrix(table(Y1 as y1, Y2 as y2))
tmbeta(T,X=x_series[0],Y=y1_matrix[0],window=10)
请先 登录 后评论
  • 1 关注
  • 0 收藏,815 浏览
  • zhengju.chen 提出于 2022-09-30 18:11

相似问题