-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3c469e
commit b79e259
Showing
10 changed files
with
61 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
#Assert function | ||
assert <- function(model,lag) { | ||
#Assert lag | ||
assert_lag <- function(lag) { | ||
if (lag>20 || typeof(lag) != "double") { | ||
stop("Lag value can not be greater than 20 and it must be integer.") | ||
stop("lag value can not be greater than 20 and it must be integer.") | ||
} | ||
|
||
} | ||
|
||
#Assert model | ||
assert_model <- function(model) { | ||
if (as.character(model$call[[1]])!="lm") { | ||
stop("model must be lm(y ~ x) object.") | ||
} | ||
} | ||
} | ||
|
||
#Assert difference | ||
assert_difference <- function(difference) { | ||
if (typeof(difference) != "double" || difference < 1) { | ||
stop("difference value must be integer and greater than 1.") | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#Take difference of the model data | ||
|
||
df_diff <- function(model,diff_value){ | ||
df <-data.frame(diff(as.matrix(model$model),differences = diff_value)) | ||
print(paste0("Unit root tests results prepared for difference: ",diff_value)) | ||
return(df) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.