【发布时间】:2020-09-17 23:10:52
【问题描述】:
我正在尝试构建套利投资组合 x 使得 Sx = 0 和 Ax>=0,其中 A 是 t=1 时的收益矩阵,S 是 t=0 时的价格。我无法手动完成,所以我尝试使用 R 中的 limSolve 和 lpSolve 包中包含的函数,但没有成功,因为我继续获得零向量(我需要非平凡的解决方案)。我也不知道如何自己编码。任何有关如何进行的帮助或提示将不胜感激。谢谢!
A = data.frame(
cbind(
c(2,1,0),
c(1,1,1),
c(0,1,2),
c(3,2,1),
c(1,1,0)
)
) %>% as.matrix()
f.con = A
S = data.frame(
cbind(
c(1,1,1,2,1/3)
)
) %>% as.matrix()
f.obj = c(t(S))
# Set unequality signs
f.dir <- c(">",
">",
">")
# Set right hand side coefficients
f.rhs <- c(0,
0,
0)
# Final value
lp("min", f.obj, f.con, f.dir, f.rhs)$solution
# Variables final values
lp("max", f.obj, f.con, f.dir, f.rhs)$solution
【问题讨论】: