Skip to main content

stdev

Calculate the rolling standard deviation of a target column.

Standard deviation is a measure of the amount of variation or dispersion of a set of values. It is widely used to assess the risk and volatility of financial returns or other time series data It is the square root of the variance.

Example​

from openbb import obb

stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
returns = stock_data["close"].pct_change().dropna()
obb.quantitative.stats.stdev(data=returns, target="close")

Parameters​

NameTypeDescriptionDefaultOptional
dataList[Data]The time series data as a list of data points.False
targetstrThe name of the column for which to calculate standard deviation.False

Returns​

OBBject
results : List[Data]
An object containing the rolling standard deviation values.