Skip to content

Commit

Permalink
add docs #374
Browse files Browse the repository at this point in the history
  • Loading branch information
DominiqueMakowski committed Jun 24, 2024
1 parent ebe48b4 commit ce47b60
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
15 changes: 14 additions & 1 deletion R/smoothness.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#' Quantify the smoothness of a vector
#' Series smoothness
#'
#' Functions to quantify the smoothness of a vector, which can be used in some cases
#' as an index of "linearity". A smooth series is one that does not have abrupt changes in
#' its values. The smoothness of a series can be measured in different ways, such
#' as the standard deviation of the standardized differences or the lag-one
#' autocorrelation.
#'
#' @param x Numeric vector (similar to a time series).
#' @param method Can be `"diff"` (the standard deviation of the standardized
Expand All @@ -12,6 +18,13 @@
#' plot(x)
#' smoothness(x, method = "cor")
#' smoothness(x, method = "diff")
#'
#' # A boootstrapped value can also be computed
#' smoothness(x, iterations = 100)
#'
#' # When perfectly linear, the "smoothness" is 1
#' smoothness(1:10)
#'
#' @return Value of smoothness.
#' @references https://stats.stackexchange.com/questions/24607/how-to-measure-smoothness-of-a-time-series-in-r
#'
Expand Down
15 changes: 13 additions & 2 deletions man/smoothness.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce47b60

Please sign in to comment.