Skip to content

Commit

Permalink
Fixes for smoothType and modelLags. Related to issue #204
Browse files Browse the repository at this point in the history
  • Loading branch information
config-i1 committed May 2, 2023
1 parent d49850c commit db1546e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
6 changes: 0 additions & 6 deletions R/adam.R
Original file line number Diff line number Diff line change
Expand Up @@ -10225,12 +10225,6 @@ errorType.adam <- function(object, ...){
}
}

# This is an internal function, no need to export it
# modelLags <- function(object, ...) UseMethod("modelLags")
modelLags.adam <- function(object, ...){
return(object$lagsAll);
}

#' @export
orders.adam <- function(object, ...){
return(object$orders);
Expand Down
17 changes: 5 additions & 12 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ modelName <- function(object, ...) UseMethod("modelName")
#' @export modelType
modelType <- function(object, ...) UseMethod("modelType")

modelLags <- function(object, ...) UseMethod("modelLags")

smoothType <- function(object, ...) UseMethod("smoothType")

##### Likelihood function and stuff #####

#' @importFrom greybox AICc
Expand Down Expand Up @@ -987,11 +983,14 @@ errorType.smooth <- function(object, ...){
errorType.smooth.sim <- errorType.smooth;

##### Function returns the modelLags from the model - internal function #####
modelLags.default <- function(object, ...){
modelLags <- function(object, ...){
modelLags <- NA;
if(is.msarima(object)){
modelLags <- object$modelLags;
}
else if(is.adam(object)){
modelLags <- object$lagsAll;
}
else{
smoothType <- smoothType(object);
if(smoothType=="ETS"){
Expand Down Expand Up @@ -2613,11 +2612,7 @@ simulate.smooth <- function(object, nsim=1, seed=NULL, obs=NULL, ...){
}

#### Type of smooth model. Internal function ####
smoothType.default <- function(object, ...){
return(NA);
}

smoothType.smooth <- function(object, ...){
smoothType <- function(object, ...){
if(!is.list(object$model)){
if(gregexpr("ETS",object$model)!=-1){
smoothType <- "ETS";
Expand Down Expand Up @@ -2651,8 +2646,6 @@ smoothType.smooth <- function(object, ...){
return(smoothType);
}

smoothType.smooth.sim <- smoothType.smooth;

#### Summary of objects ####
#' @export
summary.smooth <- function(object, ...){
Expand Down

0 comments on commit db1546e

Please sign in to comment.