quadp: This function provides you the pvalue based on the Pearson...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/quadp.R

Description

Main function of this package. It returns the pvalue of the quadratic form statistics.

Usage

1
quadp(y, A, mycoef)

Arguments

y

y is the vector in quadratic form y^T A y

A

A is the symmetric matrix

mycoef

global variables

Details

This is the main function in the package. It returns the test statistics of the quadratic form and its corresponding p value using Pearson family for the fitting.

Value

stat

test statistics value

p

pvalue based on the Pearson family fitting using the exact four moments

Author(s)

Yi-Hui Zhou: yihui_zhou@ncsu.edu

See Also

lincombfun, sumfun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#####  m is the dimension of the A matrix, n is the length of y        ##
#####  no row/column of A can be all constant, as this is degenerate and creates problems. 
library(PearsonDS)

m=15
n=20
set.seed(1)
x=matrix(rnorm(m*n),m,n) # just an example
y=rnorm(n)     
A=t(x-rowMeans(x))
data(mycoef)
##### The code below assumes that y and A have been presepecified or otherwise preloaded
#result=quadp(y,A,mycoef)
#print(result)

quad documentation built on May 2, 2019, 1:06 p.m.