# doubconetest: Test for a vector being in the null space of a double cone In DoubleCone: Test Against Parametric Regression Function

## Description

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.

## Usage

 `1` ```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.

## Value

 `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

## Author(s)

Mary C Meyer and Bodhisattva Sen

## 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.

`agconst`,`partlintest`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```## test against a constant function n=100 x=1:n/n mu=4-5*(x-1/2)^2 y=mu+rnorm(n) amat=matrix(0,nrow=n-1,ncol=n) for(i in 1:(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) ```