UNPKG

quantitivecalc

Version:

A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)

14 lines 1.24 kB
/** * Calculates Value at Risk (VaR) for a time series of returns using parametric, historical, or Monte Carlo methods. * * @param data - Array of objects representing time series data, each containing a column with returns. * @param returnsColumn - The key in each data object that contains the return value. * @param resultColumn - The key in each data object where the calculated VaR will be stored. * @param confidenceLevel - The confidence level for VaR calculation (e.g., 0.05 for 5% VaR, default is 0.05). * @param windowSize - The number of periods to use for the rolling window calculation (default is 252). * @param method - The method to use for VaR calculation: 'parametric', 'historical', or 'monteCarlo' (default is 'historical'). * @returns A new array of objects with VaR values added in the specified result column. If insufficient data is available for a window, the result is `null`. */ export declare function calculateVaR(data: Array<Record<string, unknown>>, returnsColumn: string, resultColumn: string, confidenceLevel?: number, // 5% VaR (95% confidence) windowSize?: number, method?: 'parametric' | 'historical' | 'monteCarlo'): Array<Record<string, unknown>>; //# sourceMappingURL=calculateVaR.d.ts.map