Skip to main content

rsquare

Get R2 Score for portfolio and benchmark selected

Source Code: [link]

openbb.portfolio.metric.rsquare(portfolio_engine: portfolio_engine.PortfolioEngine)

Parameters

NameTypeDescriptionDefaultOptional
portfolio_enginePortfolioEnginePortfolioEngine class instance, this will hold transactions and perform calculations.
Use portfolio.load to create a PortfolioEngine.
NoneFalse

Returns

TypeDescription
pd.DataFrameDataFrame with R2 Score between portfolio and benchmark for different periods

Examples

from openbb_terminal.sdk import openbb
p = openbb.portfolio.load("openbb_terminal/miscellaneous/portfolio_examples/holdings/example.csv")
output = openbb.portfolio.metric.rsquare(p)