Description
The ExponentialMovAvg function computes the exponential moving average of points in a time series, exponentially decreasing the weights of older values.
Usage
td_exponential_mov_avg_mle (
data = NULL,
target.columns = NULL,
alpha = 0.1,
start.rows = 2,
include.first = FALSE,
data.sequence.column = NULL,
data.partition.column = NULL,
data.order.column = NULL
)
Arguments
data |
Required Argument. |
data.partition.column |
Required Argument. |
data.order.column |
Required Argument. |
target.columns |
Optional Argument. |
alpha |
Optional Argument. |
start.rows |
Optional Argument. |
include.first |
Optional Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_exponential_mov_avg_mle"
which is a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator
using name: result.
Examples
# Get the current context/connection
con <- td_get_context()$connection
# Load example data.
loadExampleData("exponentialmovavg_example", "ibm_stock")
# Create object(s) of class "tbl_teradata".
ibm_stock <- tbl(con, "ibm_stock")
# Example - Compute the exponential moving average
td_exponential_mov_avg_out <- td_exponential_mov_avg_mle(data = ibm_stock,
data.partition.column = c("name"),
data.order.column = c("period"),
target.columns = c("stockprice"),
start.rows = 10,
include.first = TRUE
)