Test for a vector being in the null space of a double cone
Test for a vector being in the null space of a double cone
Given an n-vector y and the model y=m+e, and an m by n "irreducible" matrix amat, test the null hypothesis that the vector m is in the null space of amat.
doubconetest(y, amat, nsim =1000)
Arguments
y: a vector of length n
amat: an m by n "irreducible" matrix
nsim: number of simulations to approximate null distribution -- default is 1000, but choose more if a more precise p-value is desired
Details
The matrix amat defines a polyhedral convex cone of vectors x such that amat%%x>=0, and also the opposite cone amat%%x<=0. The linear space C is those x such that amat%*%x=0. The function provides a p-value for the null hypothesis that m=E(y) is in C, versus the alternative that it is in one of the two cones defined by amat.
Returns
pval: The p-value for the test
p0: The least-squares fit under the null hypothesis
p1: The least-squares fit to the "positive" cone
p2: The least-squares fit to the "negative" cone
References
TBA, Meyer, M.C. (1999) An Extension of the Mixed Primal-Dual Bases Algorithm to the Case of More Constraints than Dimensions, Journal of Statistical Planning and Inference, 81, pp13-31.
Author(s)
Mary C Meyer and Bodhisattva Sen
See Also
agconst,partlintest
Examples
## test against a constant functionn=100x=1:n/n
mu=4-5*(x-1/2)^2y=mu+rnorm(n)amat=matrix(0,nrow=n-1,ncol=n)for(i in1:(n-1)){amat[i,i]=-1;amat[i,i+1]=1}ans=doubconetest(y,amat)ans$pval
plot(x,y,col="slategray");lines(x,mu,lty=3,col=3)lines(x,ans$p1,col=2)lines(x,ans$p2,col=4)