optim.gcp: Choosing optimal model degree by gamma change-point method

View source: R/mable.r

optim.gcpR 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 M = (m0, m1), lk, loglikelihoods evaluated evaluated at m \in \{m_0, \ldots, m_1\}

Value

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

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)


mable documentation built on Aug. 24, 2023, 5:10 p.m.