Learn R Programming

stocks (version 1.1.1)

yearly.daily: Convert X-year Gain to Average Daily Gain

Description

Converts a proportion gain over one or several years to an average daily gain. For example, an investment that gains 15% over 3 years has an average daily gain of approximately 0.0186%. The formula is: daily.gain = (total.gain + 1)^(1 / (251 * years)) - 1. Here total.gain and daily.gain are proportions (e.g. 0.15 for 15%).

Usage

yearly.daily(total.gain, years = 1)

Arguments

total.gain
Numeric value (or vector) representing the proportion gain of a security or investment over the number of years specified.
years
Number of years.

Value

Numeric value indicating average daily gain.

Details

NA

References

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

See Also

NA

Examples

Run this code
# Calculate average daily gain corresponding to a 15% gain over a 3-year period 
yearly.daily(total.gain = 0.15, years = 3)

# Figure out daily gain required for various gains over a 5-year period
yearly.daily(total.gain = seq(0, 1, 0.1), years = 5)

Run the code above in your browser using DataLab