【发布时间】:2012-02-17 22:01:53
【问题描述】:
我有以下要最小化的功能:
calloptim <- function( under,strike, rf, ttoe,par) {(-(under*par[1]
-strike*exp(-rf*ttoe)*par[2]))^2}
我创建了以下对象:
res<- nlminb(c(1,1), calloptim, under= 90, strike = 100, rf =0.05, ttoe=3)
res
$par
[1] 0.9771973 1.0218072
$objective
[1] 3.412923e-16
$convergence
[1] 1
$iterations
[1] 2
$evaluations
function gradient
34 4
$message
[1] "false convergence (8)"
这很好,但现在我想获取 $par 估计值并将它们放入一个向量中,以便我可以将它们用于其他计算。
如何隔离并仅保存对象的部分结果?
【问题讨论】: