optim.gcp | R Documentation |
Choose an optimal degree using gamma change-point model with two changing shape and scale parameters.
optim.gcp(obj)
obj |
a class "mable" or 'mable_reg' object containig a vector |
a list with components
m
the selected optimal degree m
M
the vector (m0, m1)
, where m1
is the last candidate when the search stoped
mloglik
the maximum log-likelihood at degree m
interval
support/truncation interval (a, b)
lk
log-likelihoods evaluated at m \in \{m_0, \ldots, m_1\}
lr
likelihood ratios for change-points evaluated at m \in \{m_0+1, \ldots, m_1\}
pval
the p-values of the change-point tests for choosing optimal model degree
chpts
the change-points chosen with the given candidate model degrees
# simulated data
p<-c(1:5,5:1)
p<-p/sum(p)
x<-rmixbeta(100, p)
res1<-mable(x, M=c(2, 50), IC="none")
m1<-res1$m[1]
res2<-optim.gcp(res1)
m2<-res2$m
op<-par(mfrow=c(1,2))
plot(res1, which="likelihood", add=FALSE)
plot(res2, which="likelihood")
#segments(m2, min(res1$lk), m2, res2$mloglik, col=4)
plot(res1, which="change-point", add=FALSE)
plot(res2, which="change-point")
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.