0

我正在尝试使用代码获取 3D 图:

library(plot3Drgl)
library(moments)

#PDF function:
f = function(x,par){
  delta=par[1];theta =par[2]; alpha= par[3]
  D =   (2 * theta * alpha * (x^(alpha-1)) * exp(2*x^alpha) * (1-exp(-x^alpha))  )/(gamma(delta)) * (exp(-(exp(x^alpha) - 1)^2)) * (1 - exp(-(exp(x^alpha) - 1)^2))^(theta - 1) * (-theta* log ((1 - exp(-(exp(x^alpha) - 1)^2))))^(delta-1)
  
return(D)}

delta= seq(1,5,.1)
alpha= seq(1.5,5,.1)
G_kurt<- function(delta,alpha) {
  x <- seq(0, 10, le = 2*10^4)
  U=f(x,c(delta,1.5,alpha))
  Kurtosis= kurtosis(U) 
  return(Kurtosis)}
G_kurt<-Vectorize(G_kurt, c('delta', 'alpha'))
Kurtosis<-outer(delta,alpha,G_kurt)
persp3D(delta,alpha, Kurtosis,main=expression(paste(GOBXW(delta,1.5,alpha))),xlab="delta",ylab="alpha",zlab="Kurtosis",col = "red", shade = 0.5 )

我尝试了几个 seq(from,to,by),我只有空的情节和警告信息:

Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
4

0 回答 0