Description Usage Arguments Value Examples
Change-point detection for continuous data with known post-change distributions using the statistic-based stopping rule.
1 2 3 4 5 |
GEN |
A function of time that returns an observation. |
alpha |
A numeric parameter in |
nulower, nuupper |
Optional nonnegative numerics: The earliest and latest
time of change-point based on prior belief. The default is |
score |
An optional character specifying the type of score to be used:
The default |
ULP0, GLP0, LLP0, ULP1, GLP1, LLP1 |
Functions of an observation: The log
unnormalized probability function, its gradient and its laplacian for the
pre-change ( |
par0, par1 |
Optional numeric parameters for the pre-change ( |
lenx |
A positive numeric: The length of the variable of an
obervation. Optional if |
lower0, upper0, lower1, upper1 |
Optional numeric vectors of length |
A positive numeric: The stopping time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##Change from N(0,1) to N(1,1) at t=15.
##Prior knowledge suggests change occurs between 10 and 25.
GEN=function(t) { if(15>=t) rnorm(1) else rnorm(1)+1 }
ULP0=function(x) -x^2/2
ULP1=function(x) -(x-1)^2/2
GLP0=function(x) -x
GLP1=function(x) -(x-1)
LLP0=function(x) -1
LLP1=function(x) -1
par0=log(2*pi)/2;par1=par0
#using hyvarinen score
detect.stat(GEN=GEN,alpha=0.1,nulower=10,nuupper=25,
GLP0=GLP0,LLP0=LLP0,GLP1=GLP1,LLP1=LLP1)
#using log score. normalizing constant is unknown
detect.stat(GEN=GEN,alpha=0.1,nulower=10,nuupper=25,
score="log",ULP0=ULP0,ULP1=ULP1,lenx=1)
#using log score. normalizing constant is known
detect.stat(GEN=GEN,alpha=0.1,nulower=10,nuupper=25,
score="log",ULP0=ULP0,ULP1=ULP1,par0=par0,par1=par1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.