R/loo.ind.cpt.R

Defines functions loo.ind.cpt

loo.ind.cpt=function(del.point,data,...){
  # function to generate a single loo dataset and apply the PELT algorithm to the data
  
  # del.point     The index of the point to delete
  # data          The original data
  # ...           arguments to be passed to the changepoint method
  
  n=length(data)
  if(any(del.point<1)){stop('del.point is less than 1')}
  else if(any(del.point>n)){stop('del.point is larger than the length of the data')}
  
  # generate the data
  data=data[-del.point]
  
  # apply the changepoint approach to the reduced data
  del.ans=cpt.mean(data,...)
  
  # retrieve the relevant output
  # class vector
  
  # parameter values
  
  # return the output
  return(del.ans)
  
}

Try the changepoint.influence package in your browser

Any scripts or data that you put into this service are public.

changepoint.influence documentation built on Aug. 4, 2021, 5:06 p.m.