CalcAlpha: Calculate coefficients of each interval

Description Usage Arguments Author(s) References Examples

Description

This function is a part of DP approach. This function calculates coefficients of each interval.

Usage

1
CalcAlpha(x, y, n, p, i, j)

Arguments

x

input data x

y

input data y

n

number of data samples

p

dimension of data

i

from index i

j

to index j

Author(s)

Bingwen Zhang

References

Bingwen Zhang, Jun Geng and Lifeng Lai, Detecting changes in regression models via sparse group lasso, http://users.wpi.edu/~bzhang/icassp_v1.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, y, n, p, i, j) 
{
    A <- matrix(0, p, p)
    B <- matrix(0, p, 1)
    for (t in i:j) {
        A <- A + x[t, ] %*% t(x[t, ])
        B <- B + y[t] * x[t, ]
    }
    alpha <- ginv(A) %*% B
    return(alpha)
  }

boris109able/ChangePointCalc documentation built on May 13, 2019, 12:34 a.m.