- x <- rf(10,2,3)
- m <- 10;r <- 5;n <- length(x);k <- 0.2
- alpha <- c(1,2)
- beta <- c(3,4)
- shape <- r+alpha
- ##step2
- scale_b <- beta[2]-sum(log(x[1:r]))
- b <- rgamma(m,shape[2],scale=scale_b)
- ##step1
- scale_p <-beta[1]+sum(log(1+x^b)+(n-r)*log(1+x[r]^b))
- p <- rgamma(m,shape[1],scale=scale_p)
- ##step 3
- pb <- matrix(cbind(p,b),ncol=2,byrow=F)
- ##step4
- h3_func<-function(b){
- return(scale_p^shape[1]*exp(-1*sum(log(1+x[1:r]^b))))
- }
- g_func <- function(z,y){
- return(sqrt(z^2+y^2))
- }
- gsel <- sum(g_func(pb[1:m,1],pb[1:m,2])*h3_func(pb[1:m,2]))/sum(h3_func(pb[1:m,2]))
- glinex <--1*(1/k)*log(
- sum(h3_func(pb[1:m,2])/exp(k*g_func(pb[1:m,1],pb[1:m,2]))
- )/sum(h3_func(pb[1:m,2]))
- )


雷达卡




京公网安备 11010802022788号







