slope_change function

This function fits to a numerical vector sorted in the non decreasing order two simple linear regressions and returns the index corresponding to the estimated change between the two regression models.

This function fits to a numerical vector sorted in the non decreasing order two simple linear regressions and returns the index corresponding to the estimated change between the two regression models.

slope_change(Y)

Arguments

  • Y: numerical vector sorted in the non decreasing order.

Returns

K the index corresponding to the estimated change between the two linear regression models.

Examples

n <- 30 q <- 100 Sigma <- Simu_Sigma(q = q, diag = FALSE, equal = TRUE) Matrix::image(Sigma) E <- matrix(rnorm(n * q), ncol = q) %*% chol(as.matrix(Sigma)) corE <- cor(as.matrix(E)) vec_up_emp <- corE[upper.tri(corE)] G <- matrix(0, ncol = (q - 1), nrow = (q - 1)) G[upper.tri(G, diag = TRUE)] <- vec_up_emp G[lower.tri(G)] <- t(as.matrix(G))[lower.tri(t(as.matrix(G)))] res_svd <- svd(G) vp <- res_svd$d slope_change(vp)
  • Maintainer: Marie Perrot-Dockès
  • License: GPL (>= 2)
  • Last published: 2019-04-13

Useful links