set.seed(1234)
   x <- c(2,rnorm(4,0,1),1.8,3.1,4.0)
   d <- c(3.2,4.6)
   V <- t(matrix(c(1/sqrt(2),-1/sqrt(2),0,
                 1/sqrt(6),1/sqrt(6),-2/sqrt(6)),
                 nrow=2,byrow=TRUE))
   D <- 3
   shape1 <- x[1]
   scale <- bval(D,x,d,V)
   shape2 <- x[(length(x)-D+1):length(x)]
# Expectation
   MeanA.SGB(shape1,scale,shape2)
# Mode
   ModeA.SGB(shape1, scale, shape2)
## Arctic lake data
# oilr is a SGB regression object
data(oilr) 
MeanAobj.SGB(oilr)   # is the same as oilr[["meanA"]]
ModeAobj.SGB(oilr)
Run the code above in your browser using DataLab