| Type: | Package | 
| Title: | Sequential Change-Point Tests for Generalized Ornstein-Uhlenbeck Processes | 
| Version: | 0.2.1 | 
| Description: | Sequential change-point tests, parameters estimation, and goodness-of-fit tests for generalized Ornstein-Uhlenbeck processes. | 
| Depends: | R (≥ 3.5.0), doParallel, parallel, foreach, stats | 
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.3.2 | 
| NeedsCompilation: | no | 
| Packaged: | 2025-08-23 01:27:06 UTC; Utilisateur | 
| Author: | Yunhong Lyu [aut, ctb, cph], Bouchra R. Nasri [aut, ctb, cph], Bruno N Remillard [aut, cre, cph] | 
| Maintainer: | Bruno N Remillard <bruno.remillard@hec.ca> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-08-28 08:40:02 UTC | 
Simulation of multidimensional Brownian motion
Description
This function is used to simulate multidimensional Brownian motion at points 0,1/n, ..., 1.
Usage
SimBM(n, d)
Arguments
| n | Number of simulated | 
| d | Dimension of BM | 
Value
| W | Brownian motion | 
Examples
W =  SimBM(100,4)
Simulation of generalized Ornstein-Uhlenbeck (GOU) process
Description
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.
Usage
SimGOUexact(T1, N, t_star = 0, K, theta, theta_star, sigma)
Arguments
| 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 | 
Value
| X | Simulated path evaluated at points k x T1/N, 0 <= k <= N+K | 
Examples
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)
Function to estimate quantiles for residuals of generalized Ornstein-Uhlenbeck (GOU) process
Description
Computation of quantiles for Cramer-von Mises and Kolmogorov-Smirnov statistics for testing goodness-of-fit of GOU
Usage
SimQuantilesGoF(n, B = 50000, alpha = c(0.9, 0.95, 0.975, 0.99), n_cores = 2)
Arguments
| 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) | 
Value
| q | Data frame of simulated quantiles of weighted BM | 
Function to estimate quantiles for weigthed Brownian Motion functional
Description
Function to calculate the critical value for the Euclidean norm of d-dimensional BM divided by t^gamma
Usage
SimQuantilesWBM(
  n,
  d,
  gamma,
  B = 50000,
  alpha = c(0.9, 0.95, 0.975, 0.99),
  n_cores = 2
)
Arguments
| 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) | 
Value
| qs | Simulated quantiles of weighted BM | 
Change-point tests for generalized Ornstein-Uhlenbec (GOU) process
Description
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.
Usage
StatGOU(X, T1, N, p, q, gamma, c1, cd)
Arguments
| 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. | 
Value
| out | List | 
References
Lyu, Nasri and Remillard (2025): Sequential Change-point Detection with Generalized Ornstein–Uhlenbeck Processes
Examples
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
Description
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)
Usage
data(X)Format
Simulated GOU process (X)
Examples
data(X)
Function calculating basis cosine function
Description
This function computes the normalized cosine function.
Usage
fcos(s)
Arguments
| s | Parameter of function | 
Value
| f | Normalized cosine function | 
Function calculating basis sine function
Description
This function computes the normalized sine function.
Usage
fsin(s)
Arguments
| s | Parameter of function | 
Value
| f | Normalized sine function | 
Function used to perform parallel computing for weighted norm of multidimensional Brownian motion
Description
This function simulates weighted Euclidean norm for multidimensional BM.
Usage
funBM(n, d, gamma)
Arguments
| n | Number of simulated points; | 
| d | Dimension of BM; | 
| gamma | Weighted exponent (>= 0, < 0.5). | 
Value
| stat | Weighted norm of multidimensional BM | 
Function used to perform parallel computing for pseudo-observations of generalized Ornstein-Uhlenbeck
Description
This function simulates values of the Cramer-von Mises and Kolmogorov-Smirnov statistics for testing goodness-of-fit of GOU.
Usage
funGoF(n)
Arguments
| n | number of simulated points. | 
Value
| out | List of gof statistics for GOU: ks (Kolmogorov-Smirnov) and cvm ( Cramer-von Mises) | 
Function to estimate quantiles for a goodness-of-fit test for generalized Ornstein-Uhlenbeck process
Description
Function to calculate the quantiles of Cramer-von Mise and Kolmogorov-Smirnov statistics.
Usage
gof_stat(X, T1, N, p, q)
Arguments
| 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 | 
Value
| out | List of statistics (cvm and ks), estimated parameters, and pseudo-observations | 
Examples
T1=20
N=500
data(X)
out = gof_stat(X,T1,N,2,0)
Change-point statistics for GOU
Description
Function to compute Sigma covariance matrix and kappas of change-point statistics
Usage
kappa(theta, theta_star, sigma)
Arguments
| 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 | 
Value
| out | List containing Sigma and kappas for Q and G statistics | 
Examples
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)