Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for changepoint Version 2.3.1 #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ Type: Package
Title: Detection of Structural Changes in Climate and Environment Time
Series
Version: 1.1.1
Date: 2018-09-13
Date: 2019-09-22
Authors@R: c(person("Rebecca", "Killick", role=c("aut","cre"),email="[email protected]"),
person("Claudie", "Beaulieu", role="aut"), person("Simon", "Taylor", role="aut"),person("Harjit","Hullait",role="aut"))
person("Claudie", "Beaulieu", role="aut"), person("Simon", "Taylor", role="aut"))
Maintainer: Rebecca Killick <[email protected]>
URL: https://github.com/rkillick/EnvCpt/
Description: Tools for automatic model selection and diagnostics for Climate and Environmental data. In particular the envcpt() function does automatic model selection between a variety of trend, changepoint and autocorrelation models. The envcpt() function should be your first port of call.
Depends: R(>= 3.3), changepoint(>= 2.2.2), grDevices, MASS,
Depends: R(>= 3.3), changepoint(>= 2.3.1), grDevices, MASS,
methods, stats, utils, zoo
Suggests: testthat
License: GPL
LazyLoad: yes
Packaged: 2018-09-13 13:46:06 UTC; killick
Packaged: 2019-09-22 19:46:06 UTC; killick
NeedsCompilation: yes

1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
useDynLib(EnvCpt)
import(methods)
import(graphics)
importFrom(MASS,fitdistr)
Expand Down
199 changes: 0 additions & 199 deletions R/CptReg.R

This file was deleted.

12 changes: 6 additions & 6 deletions R/envcpt.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ envcpt=function(data,models=c("mean","meancpt","meanar1","meanar2","meanar1cpt",

# mean+AR1+cpt
if(any(models=="meanar1cpt")|any(models==5)){
meanarcpt.fit=cpt.reg(cbind(data[-1],rep(1,n-1),data[-n]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
meanarcpt.fit=changepoint::cpt.reg(cbind(data[-1],rep(1,n-1),data[-n]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
if(ncpts(meanarcpt.fit)==0){
if(any(models=="meanar1")|any(models==3)){meanarcpt.loglik=meanar.loglik}
else{meanarcpt.loglik=logLik(meanarcpt.fit)[1]} # function from changepoint
Expand All @@ -72,7 +72,7 @@ envcpt=function(data,models=c("mean","meancpt","meanar1","meanar2","meanar1cpt",

# mean+AR2+cpt
if(any(models=="meanar2cpt")|any(models==6)){
meanar2cpt.fit=cpt.reg(cbind(data[-c(1:2)],rep(1,n-2),data[2:(n-1)],data[1:(n-2)]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
meanar2cpt.fit=changepoint::cpt.reg(cbind(data[-c(1:2)],rep(1,n-2),data[2:(n-1)],data[1:(n-2)]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
if(ncpts(meanar2cpt.fit)==0){
if(any(models=="meanar2")|any(models==4)){meanar2cpt.loglik=meanar.loglik}
else{meanar2cpt.loglik=logLik(meanar2cpt.fit)[1]} # function from changepoint
Expand All @@ -98,7 +98,7 @@ envcpt=function(data,models=c("mean","meancpt","meanar1","meanar2","meanar1cpt",

# trend+cpt
if(any(models=="trendcpt")|any(models==8)){
trendcpt.fit=cpt.reg(cbind(data,rep(1,n),1:n),method='PELT',minseglen=minseglen,...) # default MBIC penalty
trendcpt.fit=changepoint::cpt.reg(cbind(data,rep(1,n),1:n),method='PELT',minseglen=minseglen,...) # default MBIC penalty
if(ncpts(trendcpt.fit)==0){
if(any(models=="trend")|any(models==7)){trendcpt.loglik=trend.loglik}
else{trendcpt.loglik=logLik(trendcpt.fit)[1]} # function from changepoint
Expand Down Expand Up @@ -131,7 +131,7 @@ envcpt=function(data,models=c("mean","meancpt","meanar1","meanar2","meanar1cpt",

# trend+AR1+cpt
if(any(models=="trendar1cpt")|any(models==11)){
trendarcpt.fit=cpt.reg(cbind(data[-1],rep(1,n-1),1:(n-1),data[-n]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
trendarcpt.fit=changepoint::cpt.reg(cbind(data[-1],rep(1,n-1),1:(n-1),data[-n]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
if(ncpts(trendarcpt.fit)==0){
if(any(models=="trendar1")|any(models==9)){trendarcpt.loglik=trendar.loglik}
else{trendarcpt.loglik=logLik(trendarcpt.fit)[1]} # function from changepoint
Expand All @@ -148,7 +148,7 @@ envcpt=function(data,models=c("mean","meancpt","meanar1","meanar2","meanar1cpt",

# trend+AR2+cpt
if(any(models=="trendar2cpt")|any(models==12)){
trendar2cpt.fit=cpt.reg(cbind(data[-c(1:2)],rep(1,n-2),1:(n-2),data[2:(n-1)],data[1:(n-2)]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
trendar2cpt.fit=changepoint::cpt.reg(cbind(data[-c(1:2)],rep(1,n-2),1:(n-2),data[2:(n-1)],data[1:(n-2)]),method="PELT",minseglen=minseglen,...) # default MBIC penalty
if(ncpts(trendar2cpt.fit)==0){
if(any(models=="trendar2")|any(models==10)){trendar2cpt.loglik=trendar2.loglik}
else{trendar2cpt.loglik=logLik(trendar2cpt.fit)[1]} # function from changepoint
Expand Down Expand Up @@ -186,4 +186,4 @@ envcpt=function(data,models=c("mean","meancpt","meanar1","meanar2","meanar1cpt",
if(verbose==TRUE){close(pb)}
class(out)="envcpt"
return(out)
}
}
Loading