Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Compute the weighted return of a portfolio from individual asset returns.
let portfolioReturn weights returns =
List.map2 (*) weights returns |> List.sum
let weights = [0.6; 0.4]
let returns = [0.02; 0.03]
let pReturn = portfolioReturn weights returns
printfn "Portfolio Return: %f" pReturnF# is a functional-first programming language on the .NET platform, widely used in finance for quantitative modeling, risk analysis, and algorithmic trading due to its strong type system, immutability, and functional programming paradigms.
Origin & Creator
Developed by Microsoft Research in 2005, evolving from OCaml to provide functional-first programming on .NET for both academic and industry applications.
Industrial Note
Extensively used in investment banks, hedge funds, and fintech for quantitative analytics, derivatives pricing, portfolio optimization, and real-time risk management.