[R] wrong when use the function fast99 in package "Sensitivity"

何亮
Tue, 09 Jul 2013 06:57:48 -0000

Pn_I<-function(x){

  I<-1000
  Rp<-x[4]*(1-x[5]*I)*I/(1+x[6]*I)
  Pn<-x[1]*(1-x[2]*I)*I/(1+x[3]*I)-Rp-x[7]
  return(Pn)

}




Pn_I_sensitivity <- fast99(model = Pn_I,
factors=c("alpha","beta","gamma","delta","lammda","omiga","Rd"),
                           n = 3000,q =rep("qunif",7), q.arg =
list(alpha=list(min=0,max=1),

beta=list(min=0,max=1),gamma=list(min=0,max=1),delta=list(min=0,max=1),
                           lammda=list(min=0,max=1),omiga=list(min=0,max=1),
Rd=list(min=0,max=4)))


print(Pn_I_sensitivity)
plot(Pn_I_sensitivity)


the results as follow

Error in response(x, ...) :
  (list) object cannot be coerced to type 'double'


does anybody know where is wrong in my code?
--
ºÎÁÁ
ÖÐ¹ú¿ÆÑ§Ôº´óÑ§ µØÀí¿ÆÑ§Óë×ÊÔ´ÑÐ¾¿Ëù Â½µØË®Ñ»·ÓëµØ±í¹ý³ÌÖØµãÊµÑéÊÒ
±±¾©ÊÐ ³¯ÑôÇø ´óÍÍÂ·¼×11ºÅ
µç»°£º13651318417
Liang He
Institute of Geographic Sciences and Natural resource research
Chinese Academy of Science,
No.11, Datun Road, Chaoyang District,
Beijing 100101, China
Email: xhl860728@163.com
Tel: +86(10) 6488 9513
Mob:+86 0 13651318417






	[[alternative HTML version deleted]]