Repository navigation
Modern Finance Alpha
Paul Squires edited this page Oct 19, 2026
·
4 revisions
Home › Finance › Finance › Alpha
Returns the annualized return beyond what the asset's beta to its benchmark explains.
Alpha( assetReturns( ), benchmarkReturns( ), riskFreePerPeriod, frequency )#import "std/money"
using money
'' Jensen's alpha, annualized: the excess earned beyond what the
'' portfolio's beta exposure to the benchmark would explain.
dim as float64 r( 0 to 11 ) = { 0.02, -0.01, 0.03, 0.015, -0.025, 0.04, _
0.01, -0.005, 0.02, 0.03, -0.015, 0.025 }
dim as float64 b( 0 to 11 ) = { 0.018, -0.012, 0.025, 0.012, -0.02, 0.035, _
0.008, -0.004, 0.018, 0.028, -0.012, 0.022 }
print Alpha( r( ), b( ), 0.0002, RETURN_MONTHLY ).Value( ) '' 0.0007384440443476345
'' A portfolio that IS its benchmark has no alpha, by construction --
'' zero to within floating-point residue, which is why this is a
'' tolerance rather than a comparison against exactly 0.
dim as boolean noAlpha = _
( abs( Alpha( b( ), b( ), 0.0002, RETURN_MONTHLY ).Value( ) ) < 1.0e-12 )
print noAlpha '' trueLibrary: Finance
Category: Finance
Documented under: Nothing Becomes A Keyword
Source: pkg/std/money/finport.tiko in the tiko repository.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing