optim.gcp {mable} | R Documentation |
Choosing optimal model degree by gamma change-point method
Description
Choose an optimal degree using gamma change-point model with two changing shape and scale parameters.
Usage
optim.gcp(obj)
Arguments
obj |
a class "mable" or 'mable_reg' object containig a vector |
Value
a list with components
-
m
the selected optimal degreem
-
M
the vector(m0, m1)
, wherem1
is the last candidate when the search stoped -
mloglik
the maximum log-likelihood at degreem
-
interval
support/truncation interval(a, b)
-
lk
log-likelihoods evaluated atm \in \{m_0, \ldots, m_1\}
-
lr
likelihood ratios for change-points evaluated atm \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
Examples
# 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)