weight_from_scores: Map scores to portfolio weights

View source: R/ml.R

weight_from_scoresR Documentation

Map scores to portfolio weights

Description

Map scores to portfolio weights

Usage

weight_from_scores(
  scores,
  method = c("softmax", "rank", "linear", "equal"),
  temperature = 10,
  floor = 0
)

Arguments

scores

Wide score panel (Date + symbols).

method

"softmax", "rank", "linear", "equal".

temperature

softmax temperature (higher=flatter).

floor

non-negative number added before normalization.

Value

weight panel (Date + symbols) with non-negative rows summing to 1 over active dates.


PortfolioTesteR documentation built on Nov. 5, 2025, 5:23 p.m.