compute_return: Compute simple or logarithmic returns

View source: R/calculations.R

compute_returnR Documentation

Compute simple or logarithmic returns

Description

compute_return computes simple or logarithmic returns for a vector of values. The function uses calc_simple_return and calc_log_return.

Usage

compute_return(x = NULL, type = c("simple", "log"))

Arguments

x

numeric vector

type

either "simple" or "log"

Details

Used in scripts: Robust function: TRUE

Value

If x is a vector of length > 1, returns a vector of equal length to input vector with returns and codeNA_real_ in first position


AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.