Description Usage Arguments Value Examples
Change-point detection for binary data with known post-change distributions using the statistic-based stopping rule.
1 2 3 |
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, ULP1 |
Functions of an observation: The log unnormalized
probability function 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 |
tbin |
Optional numeric specifying the binary type: The default
|
A positive numeric: The stopping time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##Change from 3 iid Bernoulli(0.2) to 3 iid Bernoulli(0.8) at t=10.
##Prior knowledge suggests change occurs before 20.
GEN=function(t) { if(10>=t) rbinom(3,1,0.2) else rbinom(3,1,0.8)}
ULP0=function(x) sum(x)*(log(0.2)-log(1-0.2))
ULP1=function(x) sum(x)*(log(0.8)-log(1-0.8))
par0=-3*log(1-0.2)
par1=-3*log(1-0.8)
#using hyvarinen score
detect.bin.stat(GEN=GEN,alpha=0.1,nuupper=20,ULP0=ULP0,ULP1=ULP1)
#using log score. normalizing constant is unknown
detect.bin.stat(GEN=GEN,alpha=0.1,nuupper=20,score="log",ULP0=ULP0,ULP1=ULP1,lenx=3)
#using log score. normalizing constant is known
detect.bin.stat(GEN=GEN,alpha=0.1,nuupper=20,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.