compute_historical_price_means: Return historical price means computed with decay factor

Description Usage Arguments Value Functions

View source: R/portfolio_utils.R

Description

We define the historical price mean MA_t at time t to be

MA_t = decay_factor \cdot p_t + (1-decay_factor) \cdot MA_{t-1}

And MA_1 = p_1.

Usage

1
2
3
4
5
6
7
compute_historical_price_means(prices, decay_factor = 0.5, .check_input = TRUE)

compute_historical_price_mean_matrix(
  price_matrix,
  decay_factor = 0.5,
  .check_input = TRUE
)

Arguments

prices

A vector of prices

decay_factor

the decay factor for the mean (see description)

.check_input

If TRUE, checks that input meets the given assumptions.

price_matrix

A matrix of prices, where each row represents a trading period and each column represents an asset

Value

A vector with the same dimension as prices with historical price means as the entries

Functions


benSepanski/pfselect documentation built on May 1, 2020, 1:57 p.m.