BreakDiagnostic: Detect a break number using different metrics

View source: R/BreakDiagnostic.R

BreakDiagnosticR Documentation

Detect a break number using different metrics

Description

Detect a break number using different metrics

Usage

BreakDiagnostic(
  y,
  X,
  mcmc = 100,
  burn = 100,
  verbose = 100,
  thin = 1,
  break.upper = 3
)

Arguments

mcmc

The number of MCMC iterations after burnin.

verbose

A switch which determines whether or not the progress of the sampler is printed to the screen. If verbose is greater than 0 the iteration number, the β vector, and the error variance are printed to the screen every verboseth iteration.

thin

The thinning interval used in the simulation. The number of MCMC iterations must be divisible by this value.

break.upper

Upper threshold for break number detection. The default is break.upper = 3.

Y

Reponse tensor

R

Dimension of latent space. The default is 2.

burnin

The number of burn-in iterations for the sampler.

degree.normal

A null model for degree correction. Users can choose "NULL", "eigen" or "Lsym." "NULL" is no degree correction. "eigen" is a principal eigen-matrix consisting of the first eigenvalue and the corresponding eigenvector. " Lsym" is a modularity matrix. Default is "eigen."

UL.Normal

Transformation of sampled U. Users can choose "NULL", "Normal" or "Orthonormal." "NULL" is no normalization. "Normal" is the standard normalization. "Orthonormal" is the Gram-Schmidt orthgonalization. Default is "NULL."

v0

v_0/2 is the shape parameter for the inverse Gamma prior on variance parameters for V. If v0 = NULL, a value is computed from a test run of NetworkStatic.

v1

v_1/2 is the scale parameter for the inverse Gamma prior on variance parameters for V. If v1 = NULL, a value is computed from a test run of NetworkStatic.

Examples

   ## Not run: 
   set.seed(1973)
   ## One break test
   out <- BridgeChangeSim(ntime=20, predictor = 10, n.break=1, constant.p =0, varying.p = 0.4, dgp.only=TRUE)

   ## Fit multiple models for break number detection using Bayesian model comparison
   detect <- BreakDiagnostic(y=out$y.c, X=out$x.c)
   
   ## Look at the graph
   detect[[1]]; print(detect[[2]])

   ## Two break test
   out <- BridgeChangeSim(ntime=20, predictor = 10, n.break=2, constant.p =0, varying.p = 0.4, dgp.only=TRUE)

   ## Fit multiple models for break number detection using Bayesian model comparison
   detect <- BreakDiagnostic(y=out$y.c, X=out$x.c)
   
   ## Look at the graph
   detect[[1]]; print(detect[[2]])
  

## End(Not run)



jongheepark/BridgeChange documentation built on Jan. 12, 2023, 4:48 p.m.