Description Usage Arguments Value Examples
View source: R/pelt.bck.R View source: R/pelt.R
Calculates the Gamma likelihood of multiple segments of data, as defined by the vector of possible start-points (tau
) and a single common end-point (R
). This calculation assumes the shape is fixed as some specified value and sets the scale equal to its maximum likelihood estimate.
Calculates the Gamma likelihood of multiple segments of data, as defined by the vector of possible start-points (tau
) and a single common end-point (R
). This calculation assumes the shape is fixed as some specified value and sets the scale equal to its maximum likelihood estimate.
1 2 3 | pelt.gamma.cost(tau, R, sumx, shape = 1)
pelt.gamma.cost(tau, R, sumx, shape = 1)
|
tau |
A vector of locations indicating the possible beginnings of a segment. |
R |
A single location representing the end of the possible segment |
sumx |
The summary statistics for the entire time series being analysed. |
shape |
The value of the shape parameter for the Gamma distribution. |
tau |
A vector of locations indicating the possible beginnings of a segment. |
R |
A single location representing the end of the possible segment |
sumx |
The summary statistics for the entire time series being analysed. |
shape |
The value of the shape parameter for the Gamma distribution. |
A vector containing the cost of the different possible segments defined by tau
and R
.
A vector containing the cost of the different possible segments defined by tau
and R
.
1 2 3 4 5 6 7 8 9 10 11 12 | shape = 1 # the shape parameter of the data
data = rgamma(n=100, shape=shape, scale=1/2)
sumx = pelt.gamma.sum(data)
tau = c(30,40,50) # start-points of possible segments
R = 70 # end-point of possible segments
pelt.gamma.cost(tau, R, sumx, shape=shape) # costs for each segment
shape = 1 # the shape parameter of the data
data = rgamma(n=100, shape=shape, scale=1/2)
sumx = pelt.gamma.sum(data)
tau = c(30,40,50) # start-points of possible segments
R = 70 # end-point of possible segments
pelt.gamma.cost(tau, R, sumx, shape=shape) # costs for each segment
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.