Description Usage Arguments Value References Examples
The function performs a nonparametric test showing whether two datasets have similar linear structure or not. The test is based on applying energy distance \insertCiterizzo-szekely10changedetection to residuals estimated for each dataset separately but only by one model (either first or second). It is implemented as a permutation test with R
rounds and corresponding pzero
\insertCitegorskikh17changedetection.
1 2 | changeTest(x1, y1, x2, y2, l = NULL, R = 1000, pzero = 0.05,
alpha = 1)
|
x1 |
matrix of first period regressors with variables in columns and observations in rows |
y1 |
matrix of first period responses with variables in columns and observations in rows |
x2 |
matrix of second period regressors with variables in columns and observations in rows |
y2 |
matrix of second period responses with variables in columns and observations in rows |
l |
approximate number of contributing variables (default: overall number of regressors) |
R |
number of bootstrap rounds (default: '1000') |
pzero |
trust level for bootstrap (default: '0.05') |
alpha |
parameter for energy distance formula (default: '1') |
TRUE
or FALSE
1 2 3 4 5 6 7 8 9 10 11 12 13 | T<-60
change<-35
x<-rnorm(n=T, m=0, sd=1)
e<-scale(rt(n=T,3), scale=FALSE)
y1<-5*x[1:(change-1)]+e[1:(change-1)]
y2<--2*x[change:T]+e[change:T]
y<-c(y1,y2)
testResult <- changeTest(x1=as.data.frame(x[1:T]),
y1=as.data.frame(y[1:T]),
x2=as.data.frame(x[31:T]),
y2=as.data.frame(y[31:T]),
R=200)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.