| Title: | Sequential Change-Point Tests for Generalized Ornstein-Uhlenbeck Processes |
|---|---|
| Description: | Sequential change-point tests, parameters estimation, and goodness-of-fit tests for generalized Ornstein-Uhlenbeck processes. |
| Authors: | Yunhong Lyu [aut, ctb, cph], Bouchra R. Nasri [aut, ctb, cph], Bruno N Remillard [aut, cre, cph] |
| Maintainer: | Bruno N Remillard <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.2.1 |
| Built: | 2026-05-25 08:26:48 UTC |
| Source: | https://github.com/cran/GenOU |
Function to calculate the quantiles of Cramer-von Mise and Kolmogorov-Smirnov statistics.
gof_stat(X, T1, N, p, q)gof_stat(X, T1, N, p, q)
X |
observations |
T1 |
last time of observation |
N |
number of observations on from on interval (0,T1] |
p |
number of cosine coefficients >=1 |
q |
number of sine coefficients >=0 |
out |
List of statistics (cvm and ks), estimated parameters, and pseudo-observations |
T1=20 N=500 data(X) out = gof_stat(X,T1,N,2,0)T1=20 N=500 data(X) out = gof_stat(X,T1,N,2,0)
Function to compute Sigma covariance matrix and kappas of change-point statistics
kappa(theta, theta_star, sigma)kappa(theta, theta_star, sigma)
theta |
list of parameters before change-point: cos coefficients (>=1), sine coefficients (>=0, and alpha |
theta_star |
list of parameters after change-point: cos coefficients (>=1), sine coefficients (>=0, and alpha |
sigma |
volatility parameter of the GOU process |
out |
List containing Sigma and kappas for Q and G statistics |
theta=list(cos=c(1,2),alpha=1) theta_star=list(cos=c(2,4),alpha=2) sigma=3 out = kappa(theta,theta_star, sigma)theta=list(cos=c(1,2),alpha=1) theta_star=list(cos=c(2,4),alpha=2) sigma=3 out = kappa(theta,theta_star, sigma)
This function is used to simulate multidimensional Brownian motion at points 0,1/n, ..., 1.
SimBM(n, d)SimBM(n, d)
n |
Number of simulated |
d |
Dimension of BM |
W |
Brownian motion |
W = SimBM(100,4)W = SimBM(100,4)
Function to simulate exact N+K+1 values with change point after N+K_star, with K_star = floor(N*t_star), for a GOU process. Starting point is 0.
SimGOUexact(T1, N, t_star = 0, K, theta, theta_star, sigma)SimGOUexact(T1, N, t_star = 0, K, theta, theta_star, sigma)
T1 |
Last time of observation |
N |
Number of observations on from on interval (0,T1] |
t_star |
Time of change-point after T1 |
K |
Number of observation after change-point |
theta |
list of parameters before change-point: cos coefficients (>=1), sine and sigma |
theta_star |
list of parameters after change-point: cos coefficients (>=1), sine and sigma |
sigma |
volatility parameter of the GOU process |
X |
Simulated path evaluated at points k x T1/N, 0 <= k <= N+K |
set.seed(3253) T1=20 N=500 K=2*N t_star=0 theta=list(cos=c(1,2),alpha=1) # d=3 parameters for the drift theta_star=list(cos=c(2,5),alpha=1) sigma=3 X=SimGOUexact(T1,N,t_star,K,theta,theta_star,sigma)set.seed(3253) T1=20 N=500 K=2*N t_star=0 theta=list(cos=c(1,2),alpha=1) # d=3 parameters for the drift theta_star=list(cos=c(2,5),alpha=1) sigma=3 X=SimGOUexact(T1,N,t_star,K,theta,theta_star,sigma)
Computation of quantiles for Cramer-von Mises and Kolmogorov-Smirnov statistics for testing goodness-of-fit of GOU
SimQuantilesGoF(n, B = 50000, alpha = c(0.9, 0.95, 0.975, 0.99), n_cores = 2)SimQuantilesGoF(n, B = 50000, alpha = c(0.9, 0.95, 0.975, 0.99), n_cores = 2)
n |
number of points |
B |
number of bootstrap samples (default 50000) |
alpha |
vector of probabilities (default is (.90,.95,.975,.99)) |
n_cores |
number of cores for parallel computing (default is 2) |
q |
Data frame of simulated quantiles of weighted BM |
Function to calculate the critical value for the Euclidean norm of d-dimensional BM divided by t^gamma
SimQuantilesWBM( n, d, gamma, B = 50000, alpha = c(0.9, 0.95, 0.975, 0.99), n_cores = 2 )SimQuantilesWBM( n, d, gamma, B = 50000, alpha = c(0.9, 0.95, 0.975, 0.99), n_cores = 2 )
n |
number of points |
d |
dimension of Brownian motion |
gamma |
parameter between 0 and 0.5 (not included) |
B |
number of bootstrap samples (default 50000) |
alpha |
vector of probabilities (default is (.90,.95,.975,.99)) |
n_cores |
number of cores for parallel computing (default is 2) |
qs |
Simulated quantiles of weighted BM |
Function to simulate exact N+K+1 values with change point after N+K_star, with K_star = floor(N*t_star), for a GOU process. Starting point is 0.
StatGOU(X, T1, N, p, q, gamma, c1, cd)StatGOU(X, T1, N, p, q, gamma, c1, cd)
X |
observations |
T1 |
last time of observation |
N |
number of observations on from on interval (0,T1] |
p |
number of cosine coefficients >=1 |
q |
number of sine coefficients >=0 |
gamma |
weight parameter >=0 and < 0.5 |
c1 |
critical value for Q stat (based on 1-dimensional weigthed BM) |
cd |
critical value for G stat (based on d-dimensional weigthed BM), where d = p+q+1 is the number of estimated parameters for the drift. |
out |
List |
Lyu, Nasri and Remillard (2025): Sequential Change-point Detection with Generalized Ornstein–Uhlenbeck Processes
T1=20 N=500 gamma = 0.1 p=2 q=0 c1 = 2.2838 # corresponding to gamma=0.1 c3 = 3.0502 # corresponding to gamma=0.1 and d=3 estimated parameters for the drift data(X) out=StatGOU(X,T1,N,p,q,gamma,c1,c3)T1=20 N=500 gamma = 0.1 p=2 q=0 c1 = 2.2838 # corresponding to gamma=0.1 c3 = 3.0502 # corresponding to gamma=0.1 and d=3 estimated parameters for the drift data(X) out=StatGOU(X,T1,N,p,q,gamma,c1,c3)
Simulated GOU process with set.seed(3253), theta=list(cos=c(1,2),alpha=1) theta_star=list(cos=c(2,4),alpha=2), using X=SimGOUexact(20,500,0,1000,theta,theta_star,3)
data(X)data(X)
Simulated GOU process (X)
data(X)data(X)