Running 'CER-funCER-Rcode-constr.R' [1s]
  Running 'CER-funCER-Rcode-constrjoint.R' [1s]
  Running 'CER-funCER-Rcode-joint.R' [1s]
  Running 'GNEceq-examples.R' [2s]
  Running 'GNEnseq-examples.R' [1s]
  Running 'NIR-func-Rcode.R' [5s]
  Running 'NIRandVIPexample.R' [2s]
  Running 'SSR-Rcode-funSSRcheck-constrjoint.R' [1s]
  Running 'SSR-funSSR-Rcode-constr.R' [1s]
  Running 'SSR-funSSR-funSSRcheck-constr.R' [1s]
  Running 'SSR-funSSR-funSSRcheck-constrjoint.R' [1s]
  Running 'SSR-testarg.R' [0s]
  Running 'complfunc-3Dplot.R' [1s]
  Running 'complfunc-funcFB.R' [1s]
  Running 'complfunc-limitgraph.R' [1s]
  Running 'sensi-analysis-duopoly.R' [0s]
  Running 'sensi-analysis-genduopoly.R' [1s]
  Running 'sensi-analysis-riverbasinpollution.R' [2s]
  Running 'util-testfunc.R' [1s]
Running the tests in 'tests/sensi-analysis-genduopoly.R' failed.
Complete output:
  > if(!require("GNE"))stop("this test requires package GNE.")
  Loading required package: GNE
  Loading required package: alabama
  Loading required package: numDeriv
  Loading required package: nleqslv
  Loading required package: BB
  Loading required package: SQUAREM
  > 
  > #-------------------------------------------------------------------------------
  > # (2) generalized Duopoly game of Krawczyk and Stanislav Uryasev (2000)
  > #-------------------------------------------------------------------------------
  > 
  > obj <- function(x, i, d, lam, rho)
  + 	(d - lam - rho*sum(x))*x[i]
  > 	
  > NIF <- function(x, y, par)	
  + 	obj(x, 1, par["d1"], par["lam1"], par["rho1"]) - obj(c(y[1], x[2]), 1, par["d1"], par["lam1"], par["rho1"]) + obj(x, 2, par["d2"], par["lam2"], par["rho2"]) - obj(c(x[1], y[2]), 2, par["d2"], par["lam2"], par["rho2"])
  > 	
  > grobj <- function(x, i, j, d, lam, rho)
  + {
  + 	if(i == j)
  + 		d - lam - rho*sum(x) - rho*x[i]
  + 	else
  + 		-rho*x[j]
  + }	
  > 
  > #
  > getNE <- function(param)
  + {
  + 	x1star <- 2*(param["d1"] - param["lam1"])/3/param["rho1"] - (param["d2"] - param["lam2"])/3/param["rho2"]
  + 	x2star <- 2*(param["d2"] - param["lam2"])/3/param["rho2"] - (param["d1"] - param["lam1"])/3/param["rho1"]
  + 	c(x1star, x2star)
  + }
  > 
  > 
  > 
  > getNE(c(d1=20, d2=20, lam1=4, lam2=4, rho1=1, rho2=1)) #(16/3, 16/3)
        d1       d2 
  5.333333 5.333333 
  > 
  > getNE(c(d1=20, d2=22, lam1=4, lam2=5, rho1=1, rho2=1.5))
        d1       d2 
  6.888889 2.222222 
  > 
  > 
  > genpar <- function()
  + {
  + 	d <- runif(2, 15, 25)
  + 	names(d) <- paste("d", 1:2, sep="")
  + 	lam <- runif(2, 3, 5)
  + 	names(lam) <- paste("lam", 1:2, sep="")
  + 	rho <- runif(2, 1, 3)
  + 	names(rho) <- paste("rho", 1:2, sep="")
  + 	c(d, lam, rho)
  + }
  > 
  > #--------------------------------
  > #one-player sensi analysis
  > 
  > getsensiobj <- function(param, player=1)
  + {
  + 	sapply(1:NROW(param), function(i)
  + 		{
  + 			par <- param[i, ]
  + 			#print(par)
  + 			xstar <- getNE(par)
  + 			as.numeric( obj(xstar, player, par[paste("d", player, sep="")],
  + 				par[paste("lam", player, sep="")],
  + 				par[paste("rho", player, sep="")]) )
  + 		}
  + 	)
  + 	
  + }
  > 
  > library(sensitivity)
  Error: package or namespace load failed for 'sensitivity' in library.dynam(lib, package, package.lib):
   DLL 'rlang' not found: maybe not installed for this architecture?
  Execution halted
Running the tests in 'tests/sensi-analysis-riverbasinpollution.R' failed.
Complete output:
  > if(!require("GNE"))stop("this test requires package GNE.")
  Loading required package: GNE
  Loading required package: alabama
  Loading required package: numDeriv
  Loading required package: nleqslv
  Loading required package: BB
  Loading required package: SQUAREM
  > 
  > #-------------------------------------------------------------------------------
  > # (3) River basin pollution game of Krawczyk and Stanislav Uryasev (2000)
  > #-------------------------------------------------------------------------------
  > 
  > myarg0 <- list(
  + C = cbind(c(.1, .12, .15), c(.01, .05, .01)),
  + U = cbind(c(6.5, 5, 5.5), c(4.583, 6.25, 3.75)),
  + K = c(100, 100),
  + E = c(.5, .25, .75),
  + D = c(3, .01)
  + )
  > 
  > 
  > 
  > dimx <- c(1, 1, 1)
  > #Gr_x_j O_i(x)
  > grobj <- function(x, i, j, arg)
  + {
  + 	dij <- 1*(i == j)
  + 	res <- -(-arg$D[2] - arg$C[i, 2]*dij) * x[i] 
  + 	res - (arg$D[1] - arg$D[2]*sum(x[1:3]) - arg$C[i, 1] - arg$C[i, 2]*x[i]) * dij
  + }
  > #Gr_x_k Gr_x_j O_i(x)
  > heobj <- function(x, i, j, k, arg)
  + {
  + 	dij <- 1*(i == j)
  + 	dik <- 1*(i == k)
  + 	
  + 	arg$D[2] * dik + arg$D[2] * dij + 2 * arg$C[i, 2] * dij * dik
  + }
  > 
  > dimlam <- c(2, 2, 2)
  > #g_i(x)
  > g <- function(x, i, arg)
  + 	c(sum(arg$U[, 1] * arg$E * x[1:3]) - arg$K[1],
  + 	  sum(arg$U[, 2] * arg$E * x[1:3]) - arg$K[2],
  + 	  -x[1],
  + 	  -x[2],
  + 	  -x[3])
  > #Gr_x_j g_i(x)
  > grg <- function(x, i, j, arg)
  + 	c(arg$U[j, 1] * arg$E[j], 
  + 	arg$U[j, 2] * arg$E[j], 
  + 	-1*(i ==j), 
  + 	-1*(i ==j), 
  + 	-1*(i ==j))
  > #Gr_x_k Gr_x_j g_i(x)
  > heg <- function(x, i, j, k, arg)
  + 	c(0, 0, 0, 0, 0)
  > 
  > #true value around (21.146, 16.027, 2.724, 0.574, 0.000)
  > z0 <- rep(0, sum(dimx)+sum(dimlam))
  > 
  > getNE <- function(x, control=list(maxit=100, trace=0), check=TRUE)
  + {
  + 	res <- sapply(1:NROW(x), function(i)
  + 	{
  + 		myarg <- list(
  + 			C = cbind(x[i,paste("C",1:3,sep="")], x[i,paste("C",1:3+3,sep="")]),
  + 			U = cbind(x[i,paste("U",1:3,sep="")], x[i,paste("U",1:3+3,sep="")]),
  + 			K = x[i,paste("K",1:2,sep="")],
  + 			E = x[i,paste("E",1:3,sep="")],
  + 			D = x[i,paste("D",1:2,sep="")]
  + 		)
  + 
  + 		res <- GNE.nseq(z0, dimx, dimlam, grobj=grobj, myarg, heobj=heobj, myarg, 
  + 			constr=g, myarg, grconstr=grg, myarg, heconstr=heg, myarg, 
  + 			compl=phiFB, gcompla=GrAphiFB, gcomplb=GrBphiFB, method="Newton", 
  + 			control=control)
  + 
  + 		if(any(res$par[1:3] < 0) && check)
  + 			return(rep(NA, 3))
  + 		else 
  + 			return(res$par[1:3])
  + 	}
  + 	)
  + }
  > 
  > n <- 10
  > Xinputmatrix <- t(replicate(n, unlist(myarg0) * (1 + rnorm(19, 0, .1))))
  > X2inputmatrix <- t(replicate(n, unlist(myarg0) * (1 + rnorm(19, 0, .1))))
  > 
  > Youtputs <- t(getNE(Xinputmatrix))
  > idx <- rowSums(is.na(Youtputs)) == 0
  > Youtputs <- Youtputs[idx, ]
  > Xinputmatrix <- Xinputmatrix[idx, ]
  > X2inputmatrix <- X2inputmatrix[idx, ]
  > 
  > Yarithmean <- apply(Youtputs, 1, mean)
  > Ygeomean <- apply(Youtputs, 1, function(x) prod(x^(1/3)))
  > 
  > # plot(Yarithmean)
  > # points(Ygeomean, col="red")
  > # hist(Ygeomean)
  > # hist(Yarithmean)
  > 
  > 
  > 
  > # packages
  > library(sensitivity)
  Error: package or namespace load failed for 'sensitivity' in library.dynam(lib, package, package.lib):
   DLL 'rlang' not found: maybe not installed for this architecture?
  Execution halted