我在R中使用qmap。我有obs数据(obs)和模型输出(a)都在单行和单列的数据框中。当我使用公式
fitQmapDIST(obs,an,dist="GammaDist")
我收到以下错误:
[1]
"错误错误(par = vstart,fn = fnobj,fix.arg = fix.arg,obs = 数据, :\ n L-BFGS-B需要有限的“fn' \ n" ATTR("类&#34)
[1]
"尝试错误" attr(," condition")
<simpleError in optim(par = vstart, fn
= fnobj, fix.arg = fix.arg, obs = data, ddistnam = ddistname, hessian = TRUE, method = meth, lower = lower, upper = upper, ...):
L-BFGS-B needs finite values of 'fn'>
xx中出错[!xx.NULL] [[1]]:
下标越界
有人可以告诉我为什么吗?
答案 0 :(得分:1)
尝试使用sqrt
函数,如下所示:
qmb4.fit <- fitQmap(sqrt(obsprecip),sqrt(modprecip),
method="DIST",qstep=0.001,
transfun="bernexp")
qmb4 <- doQmap(sqrt(futprecip),qmb4.fit)^2