About this question
Easy · data_manipulation · Quant Researcher interview question · polars, financial_math, time_series, preprocessing
Logarithmic returns, or continuously compounded returns, are preferred in quantitative finance due to their time-additivity property, which simplifies multi-period aggregation and statistical modeling. Unlike simple arithmetic returns, log returns allow for the summation of periodic returns to determine the total return over a timeframe, facilitating easier manipulation in time-series analysis. Task Implement a function solution(data) using the Polars library to calculate the period-over-period