Home   >   User Resources   >   Online Help
 

 

Function index Version 3.0.0

Online Help

Reference for all 1196 worksheet functions of ApaLibNET 3.0.0. In Excel, the Help on this function link in the Insert Function dialog opens the matching page here.

Getting started

Function reference

ABCDEFGHIJKLMNOPQRSTUVWZ

A

apaAbsorptionRatio 1

  • apaAbsorptionRatioCalculates the absorption ratio, i.e. the fraction of total variance explained by a given number of eigenvectors.

apaActivePassiveRatio 1

  • apaActivePassiveRatioCalculates Lo’s active/passive ratio of a portfolio, i.e. the share of the average portfolio return due to active management (time-varying weights).

apaActiveShare 1

  • apaActiveShareCalculates the active share, i.e. half the sum of absolute differences between portfolio and benchmark weights.

apaAdjustedSharpeRatio 1

  • apaAdjustedSharpeRatioCalculates the adjusted Sharpe ratio, a risk-adjusted performance measure, i.e. the Sharpe ratio with adjustments for skewness and kurtosis.

apaARIMA 4

  • apaARIMA.AutoFitSelects the integration order d with sequential KPSS stationarity tests, then fits the best ARIMA(p,d,q) model over a user-defined grid of AR and MA orders using AIC, AICc or BIC, and returns the…
  • apaARIMA.DiagnosticsReturns residual diagnostics for an ARIMA(p,d,q) model.
  • apaARIMA.EstimateEstimates an ARIMA(p,d,q) model and returns model details, coefficients and the residual series.
  • apaARIMA.ForecastForecasts an ARIMA(p,d,q) model and returns point forecasts together with forecast error variances and 95% prediction intervals.

apaAttribution 4

apaAutoCorrel 2

  • apaAutoCorrelReturns the autocorrelation coefficients up to a certain lag for one or several time series.
  • apaAutoCorrel.SpearmanReturns the autocorrelation coefficients and their +/-95% confidence bands up to a certain lag.

apaAutoCovar 1

  • apaAutoCovarReturns the autocovariances up to a certain lag for one or several time series.

B

apaBenfordLaw 1

  • apaBenfordLawTests Benford’s law (a fraud indicator) for the first digits of a series of figures.

apaBeta 8

  • apaBetaReturns the beta of one or several portfolios relative to a benchmark.
  • apaBeta.ExpWeightedReturns the beta of Y relative to X from exponentially weighted observations.
  • apaBeta.Semi.ConcordantReturns the concordant semi-betas, i.e. the betas calculated from observations where portfolio and benchmark returns are both positive or both negative.
  • apaBeta.Semi.MnegReturns the Mneg semi-betas, i.e. the betas calculated from observations where portfolio returns are positive and benchmark returns are negative (mixed-sign, negative benchmark).
  • apaBeta.Semi.MposReturns the Mpos semi-betas, i.e. the betas calculated from observations where portfolio returns are negative and benchmark returns are positive (mixed-sign, positive benchmark).
  • apaBeta.Semi.NegReturns the negative semi-betas, i.e. the betas calculated from observations where portfolio and benchmark returns are both negative.
  • apaBeta.Semi.NonConcordantReturns the non-concordant semi-betas, i.e. the betas calculated from observations where portfolio and benchmark returns have opposite signs.
  • apaBeta.Semi.PosReturns the positive semi-betas, i.e. the betas calculated from observations where portfolio and benchmark returns are both positive.

apaBiasRatio 1

  • apaBiasRatioCalculates the bias ratio, a fraud indicator, i.e. the number of returns between 0 and +nStDevs standard deviations divided by 1 plus the number of returns between -nStDevs and 0.

apaBiNormalOutliers 1

  • apaBiNormalOutliersIdentifies bivariate outliers outside the confidence ellipse of a bivariate normal distribution.

apaBlackLitterman 6

apaBlundellWardFilter 1

  • apaBlundellWardFilterRemoves first-order autocorrelation (unsmoothing) by applying the Blundell/Ward filter.

apaBonds 3

  • apaBonds.Simulate.FactorsSimulates scenarios of the common risk factors that drive bond total returns over a horizon: a parallel change of interest rates, a change of the slope of the yield curve, a market-wide change of…
  • apaBonds.TotalReturns.FromFactorsCalculates the total returns of a set of bonds over the horizon for each factor scenario produced by apaBonds.Simulate.Factors.
  • apaBonds.Simulate.TotalReturnsSimulates bond total return scenarios over a horizon in one step: it simulates the common factors as apaBonds.Simulate.Factors and reprices the bonds on them as apaBonds.TotalReturns.FromFactors.

apaBurkeRatio 1

  • apaBurkeRatioCalculates the Burke ratio, a risk-adjusted performance measure, i.e. the average excess return divided by the square root of the sum of the squared depths of the nDrawdowns largest drawdown…

C

apaCalmarRatio 1

  • apaCalmarRatioCalculates the Calmar ratio, a risk-adjusted performance measure, i.e. the average excess return divided by the maximum drawdown.

apaCaptureRatio 4

  • apaCaptureRatio.Downside.ContinuousCalculates the downside capture ratio from continuous mean returns, i.e. the mean portfolio return divided by the mean benchmark return in periods where the benchmark return is below the threshold.
  • apaCaptureRatio.Downside.DiscreteCalculates the downside capture ratio from discrete mean returns, i.e. the mean portfolio return divided by the mean benchmark return in periods where the benchmark return is below the threshold.
  • apaCaptureRatio.Upside.ContinuousCalculates the upside capture ratio from continuous mean returns, i.e. the mean portfolio return divided by the mean benchmark return in periods where the benchmark return is above the threshold.
  • apaCaptureRatio.Upside.DiscreteCalculates the upside capture ratio from discrete mean returns, i.e. the mean portfolio return divided by the mean benchmark return in periods where the benchmark return is above the threshold.

apaCategories 17

apaCauchyCdf 1

  • apaCauchyCdfCumulative distribution function of the Cauchy distribution.

apaCauchyInv 1

  • apaCauchyInvInverse of the cumulative distribution function of the Cauchy distribution, i.e. the quantile for a given probability.

apaCauchyPdf 1

  • apaCauchyPdfProbability density function of the Cauchy distribution.

apaCauchySim 1

  • apaCauchySimSimulates several random drawings from a Cauchy distribution.

apaCDaR 1

  • apaCDaR.EmpiricalCalculates empirical conditional drawdown at risk (CDaR) figures from a time series matrix of returns.

apaCDaRRatio 1

  • apaCDaRRatioReturns the conditional drawdown at risk ratio, the mean excess return divided by the absolute empirical CDaR.

apaCertaintyEquivalentReturn 1

apaCFcal 1

  • apaCFcalReturns the parameters of the Cornish-Fisher expansion (location, scale, skewness and excess kurtosis parameters) calibrated to target moments.

apaCFinv 1

  • apaCFinvInverse of the Cornish-Fisher expansion distribution, i.e. the quantile for a given probability.

apaCFmom 1

  • apaCFmomReturns the moments of the Cornish-Fisher expansion from its parameters: mean, volatility, skewness and excess kurtosis.

apaCFrnd 1

  • apaCFrndReturns a random drawing from a distribution based on the Cornish-Fisher expansion.

apaCFsim 2

  • apaCFsimSimulates random drawings from a distribution based on the Cornish-Fisher expansion.
  • apaCFsim.CorrelatedSimulates correlated random drawings from distributions based on the Cornish-Fisher expansion.

apaCharts 11

  • apaCharts.BoxesBox representation (minimum/maximum) of bivariate data, as input data for an Excel XY chart.
  • apaCharts.CategoriesReturns a structured table for plotting category data. 1st column: category index, 2nd column: constituent index, 3rd column: x value, 4th and subsequent columns: y values.
  • apaCharts.ConvexLayersCreates input data to plot all convex layers (convex polygons) of a dataset in an Excel XY chart.
  • apaCharts.DendrogramDraws a dendrogram from hierarchical clustering results in the form of an Excel XY chart.
  • apaCharts.DrawDraws a list of lines defined by two or more points, as input data for an Excel XY chart.
  • apaCharts.kNearestNeighborCreates input data for a k-nearest-neighbor (kNN) chart: for each data point, its X and Y coordinates followed by those of its k nearest neighbors, with one chart series per data point.
  • apaCharts.Line.SplitCreates input data for a line chart from a data vector split into several series.
  • apaCharts.Scatter.XCreates input data for a normalized or unit space scatter plot, each row representing a dataset.
  • apaCharts.Scatter.X.ExpandedCreates input data for a normalized or unit space scatter plot, each series representing a dataset.
  • apaCharts.Scatter.XYCreates input data for a scatter plot with several series.
  • apaCharts.Scatter.XY.SingleSeriesCreates input data for a scatter plot with several series, collapsed to a single series.

apaClassificationAccuracy 1

apaClustering 25

apaCokurts 1

  • apaCokurtsCalculates the cokurtosis matrix (population fourth central comoments, division by n).

apaCoLPM 1

  • apaCoLPMCalculates the co-lower partial moment (co-LPM) risk measure between two return series.

apaCoLPMs 3

apaConditionalSerialCorrelation 1

  • apaConditionalSerialCorrelationCalculates the conditional serial correlation, a fraud indicator, by regressing returns on lagged returns and on lagged returns below the mean.

apaConditionalSharpeRatio 1

  • apaConditionalSharpeRatioCalculates the conditional Sharpe ratio, a risk-adjusted performance measure, i.e. the average excess return divided by the historical CVaR.

apaCone 2

  • apaCone.LinearCalculates forecast intervals (cone) for an imposed linear trend through two observations of a time series.
  • apaCone.PolynomialCalculates forecast intervals (cone) for a polynomial trend fitted to a time series.

apaConfusionMatrix 1

  • apaConfusionMatrixReturns the confusion matrix for observed and predicted class labels, with rows representing actual classes and columns representing predicted classes.

apaContours 1

  • apaContoursCalculates either the contour lines of the bivariate Gaussian kernel density of two series or the Gaussian ellipses implied by their sample means, variances and correlation, together with the…

apaContribution 21

apaCopula 19

apaCorrel 17

apaCorrelationSurprise 1

  • apaCorrelationSurpriseCalculates the correlation surprise (Kinlaw/Turkington), i.e. turbulence divided by magnitude surprise, for each observation.

apaCorrels 89

  • apaCorrelsReturns the correlation matrix of a matrix of time series.
  • apaCorrels.Add.LinCombAggregates selected elements of a correlation matrix into a weighted linear combination.
  • apaCorrels.Add.PortfoliosAdds portfolios defined by a weight matrix as elements to a correlation matrix.
  • apaCorrels.AnalyzeReturns a text string containing information about the validity of a correlation matrix: valid, invalid or problematic.
  • apaCorrels.AverageReturns the equicorrelation matrix containing the average correlation.
  • apaCorrels.Average.CorrelReturns the average correlation coefficient.
  • apaCorrels.Average.Resample.StatsResamples a correlation matrix and reports statistics for the average correlation coefficient: 1) mean absolute deviation (from empirical correlations), 2) mean squared deviation, 3) mean maximum…
  • apaCorrels.AveragesCalculates the average correlation of each element (i.e. asset) with all other elements.
  • apaCorrels.BlockCreates a block correlation matrix from a correlation matrix and a block structure.
  • apaCorrels.Block.CombineBuilds a correlation matrix from two correlation matrices and an inter-block correlation coefficient.
  • apaCorrels.Block.AveragesCalculates the block averages from a correlation matrix and a block structure.
  • apaCorrels.Block.BuildBuilds an equicorrelation block correlation matrix from block correlation values and a block structure.
  • apaCorrels.Block.BoundsFinds the lower and upper bounds within which the inter- and intra-block correlations can be varied.
  • apaCorrels.Block.MaximaReturns the maximum correlations per block, given a correlation matrix and a block structure.
  • apaCorrels.Block.MinimaReturns the minimum correlations per block, given a correlation matrix and a block structure.
  • apaCorrels.Block.ReplaceReplaces the first block in a correlation matrix and adjusts the correlations with the remaining elements.
  • apaCorrels.Block.SetSets (shrinks) the correlations within one block of a correlation matrix and its correlations with the other elements towards target values.
  • apaCorrels.Block.StructureDerives the block structure from a block correlation matrix.
  • apaCorrels.BoundsReturns the lower and upper bounds within which each entry of a valid correlation matrix can be varied without changing the other entries.
  • apaCorrels.Conditional.BoxCalculates conditional correlations inside and outside a box defined by a lower and an upper quantile.
  • apaCorrels.Conditional.Box.InCalculates the conditional correlation matrix for observations where the row asset is inside a box defined by a lower and an upper quantile.
  • apaCorrels.Conditional.Box.In.JointCalculates joint conditional correlations inside a box defined by a lower and an upper quantile.
  • apaCorrels.Conditional.Box.JointCalculates joint conditional correlations inside and outside a box defined by a lower and an upper quantile.
  • apaCorrels.Conditional.Box.OutCalculates the conditional correlation matrix for observations where the row asset is outside a box defined by a lower and an upper quantile.
  • apaCorrels.Conditional.Box.Out.JointCalculates the joint conditional correlation matrix for observations where at least one of the two assets is outside a box defined by a lower and an upper quantile.
  • apaCorrels.Conditional.MeanCalculates the conditional correlation matrix for observations at or below the arithmetic mean (lower triangular part) and above the arithmetic mean (upper triangular part), conditioning on the…
  • apaCorrels.Conditional.Mean.JointCalculates the joint conditional correlation matrix for observations below the arithmetic mean (lower triangular part) and above the arithmetic mean (upper triangular part).
  • apaCorrels.Conditional.Mean.Joint.LowerCalculates the joint conditional correlation matrix for observations where both assets are at or below their arithmetic means.
  • apaCorrels.Conditional.Mean.LowerCalculates the conditional correlation matrix for observations where the row asset is at or below its arithmetic mean.
  • apaCorrels.Conditional.QuantileCalculates conditional correlations below and above a quantile.
  • apaCorrels.Conditional.Quantile.JointCalculates joint conditional correlations below and above a quantile.
  • apaCorrels.Conditional.Quantile.Joint.LowerCalculates the joint conditional correlation matrix for observations where both assets are at or below the quantile.
  • apaCorrels.Conditional.Quantile.LowerCalculates the conditional correlation matrix for observations where the row asset is at or below the quantile.
  • apaCorrels.Conditional.SigmaCalculates the conditional correlation matrix for observations below the arithmetic mean minus and above the arithmetic mean plus a number of standard deviations.
  • apaCorrels.Conditional.Sigma.JointCalculates the joint conditional correlation matrix for observations below the arithmetic mean minus and above the arithmetic mean plus a number of standard deviations.
  • apaCorrels.Conditional.Sigma.Joint.LowerCalculates the joint conditional correlation matrix for observations where both assets are at or below their arithmetic means minus nSigma sample standard deviations.
  • apaCorrels.Conditional.Sigma.LowerCalculates the conditional correlation matrix for observations where the row asset is at or below its arithmetic mean minus nSigma sample standard deviations.
  • apaCorrels.ConfidenceIntervalsReturns resampled confidence intervals for correlations.
  • apaCorrels.CramersVCalculates the Cramér’s V matrix between a set of categorical variables, i.e. a measure of association between 0 (no association) and 1 (perfect association) for each pair of columns.
  • apaCorrels.DispersionReturns the dispersion of correlations in a correlation matrix.
  • apaCorrels.DispersionsCalculates the dispersion of the correlations of each element (i.e. asset) with all other elements.
  • apaCorrels.DropDeletes one element (i.e. asset) from a correlation matrix.
  • apaCorrels.Eigenvalues.DistributionCalculates the empirical probability density function of the eigenvalues of the correlation matrix, based on resampled data.
  • apaCorrels.ExpWeightedReturns an exponentially weighted correlation matrix.
  • apaCorrels.EquiCreates an n x n correlation matrix in which all off-diagonal entries are equal to a particular value.
  • apaCorrels.FixFixes an invalid correlation matrix with the spectral method, i.e. eigenvalues below the threshold are raised to the threshold.
  • apaCorrels.FromCovarsExtracts the correlation matrix from a covariance matrix.
  • apaCorrels.FromVeclTurns the vector of the lower triangular part excluding the main diagonal into a correlation matrix.
  • apaCorrels.FromVechTurns the vector of the lower triangular part including the main diagonal into a correlation matrix.
  • apaCorrels.GerberCalculates the Gerber matrix, the equivalent of the correlation matrix based on the Gerber statistic.
  • apaCorrels.Gerber.AlteredCalculates the altered Gerber matrix, the equivalent of the correlation matrix based on the altered Gerber statistic.
  • apaCorrels.Gerber.ModifiedCalculates the modified Gerber matrix, the equivalent of the correlation matrix based on the modified Gerber statistic.
  • apaCorrels.Gerber.TableCalculates the Gerber table, i.e. the number (or percentage) of observations in which the two time series move jointly up, jointly down, or in opposite directions beyond the threshold.
  • apaCorrels.Group.SelectExtracts the correlation matrix of a group of elements from a correlation matrix.
  • apaCorrels.Group.Select.ByIndicatorsExtracts the correlation matrix of a selected group of elements from a correlation matrix, the selection being defined by indicators.
  • apaCorrels.ImpliedReturns the constant correlation matrix implied by a portfolio volatility, constituent weights and constituent volatilities.
  • apaCorrels.Implied.CVaRCalculates the implied CVaR correlation matrix: for each pair of assets, the correlation that reproduces the CVaR of a two-asset portfolio when CVaRs are aggregated like volatilities.
  • apaCorrels.IsValidReturns TRUE if the input matrix is a valid correlation matrix, otherwise FALSE.
  • apaCorrels.JaggedCalculates the correlation matrix from jagged time series data.
  • apaCorrels.KendallReturns the Kendall’s tau-b matrix of a matrix of time series.
  • apaCorrels.LeadLagCalculates leading and lagging correlation coefficients between two time series.
  • apaCorrels.MaxReturns the maximum pairwise correlation in a correlation matrix.
  • apaCorrels.MaxsCalculates the maximum correlation of each element (i.e. asset) with all other elements.
  • apaCorrels.MinReturns the minimum pairwise correlation in a correlation matrix.
  • apaCorrels.MinsCalculates the minimum correlation of each element (i.e. asset) with all other elements.
  • apaCorrels.MSDCalculates the mean squared deviation between two correlation matrices.
  • apaCorrels.MultipleCorrelsCalculates the multiple correlation coefficients, i.e. the correlation of a regression of each variable on all other variables.
  • apaCorrels.NonGroup.SelectExtracts the correlation matrix of the elements not belonging to a group from a correlation matrix.
  • apaCorrels.PartialDerives the partial correlation matrix from a correlation matrix.
  • apaCorrels.PearsonToSpearmanConverts Pearson correlations into Spearman rank correlations, assuming a multivariate normal distribution.
  • apaCorrels.Resample.StatsResamples a correlation matrix and reports statistics for the correlation matrices: 1) mean absolute deviation (from empirical correlations), 2) mean squared deviation, 3) mean maximum deviation…
  • apaCorrels.RandomGenerates a valid random correlation matrix.
  • apaCorrels.RandomizePerturbs a correlation matrix in a random manner without rendering it invalid, by shrinking it towards a random correlation matrix.
  • apaCorrels.RemoveRemoves the correlations between time series (Gram-Schmidt orthogonalization), preserving their means and volatilities.
  • apaCorrels.ReorderReorders a correlation matrix based on a vector of indices.
  • apaCorrels.ShiftShifts the elements of a correlation matrix such that a particular element becomes the first one.
  • apaCorrels.ShrinkShrinks a correlation matrix towards a target: a correlation value, the average correlation or the smallest possible equicorrelation.
  • apaCorrels.SortedBy.AveragesSorts a correlation matrix by the average correlation of each element.
  • apaCorrels.SortedBy.DispersionsSorts a correlation matrix by the correlation dispersion of each element.
  • apaCorrels.SortedBy.LoadingsPCSorts a correlation matrix by the loadings to a particular principal component.
  • apaCorrels.SortedBy.LoadingsPC.OrderReturns the rank order of the elements of a correlation matrix, sorted by the loadings to a particular principal component.
  • apaCorrels.SortedBy.MaxsSorts a correlation matrix by the largest value in each row/column.
  • apaCorrels.SortedBy.MinsSorts a correlation matrix by the smallest value in each row/column.
  • apaCorrels.SpearmanReturns the Spearman rank correlation matrix of a matrix of time series.
  • apaCorrels.SpearmanToPearsonConverts Spearman rank correlations into Pearson correlations, assuming a multivariate normal distribution.
  • apaCorrels.SwapSwaps two constituents in a correlation matrix, i.e. exchanges the corresponding rows and columns.
  • apaCorrels.FisherTransform.ToBoundedTransforms unbounded real numbers into bounded correlation coefficients in [-1, +1] (inverse Fisher transformation).
  • apaCorrels.FisherTransform.ToUnboundedTransforms bounded correlation coefficients into unbounded real numbers (Fisher transformation).
  • apaCorrels.Ultrametric.FromCorrelsDerives the ultrametric correlation matrix from a correlation matrix.

apaCoskews 1

  • apaCoskewsCalculates the coskewness matrix (joint third moments).

apaCoUPM 1

  • apaCoUPMCalculates the co-upper partial moment (co-UPM) risk measure between two return series.

apaCoUPMs 3

apaCovar 2

apaCovars 14

  • apaCovarsReturns the sample or population covariance matrix of a matrix of time series.
  • apaCovars.Add.PortfoliosAdds portfolios defined by a weight matrix as elements to a covariance matrix.
  • apaCovars.DownsideCalculates the downside semi-covariance matrix of a return matrix.
  • apaCovars.Downside.MeansCalculates the downside semi-covariance matrix of a return matrix.
  • apaCovars.ExpWeightedCalculates the exponentially weighted covariance matrix from a time series matrix.
  • apaCovars.FixFixes the embedded correlation matrix of a covariance matrix if it is invalid.
  • apaCovars.FromVolaCorrsCalculates the covariance matrix from a volatility vector and a correlation matrix.
  • apaCovars.FromVechBuilds the covariance matrix from a vector containing the elements of the lower triangular part including the main diagonal, i.e. covariances and variances.
  • apaCovars.JaggedReturns the covariance matrix of a jagged matrix of time series.
  • apaCovars.Semi.ConcordantCalculates the semi-concordant covariance matrix from time series data, i.e. the covariances of observations moving in the same direction.
  • apaCovars.Semi.NegCalculates the semi-negative covariance matrix from time series data, i.e. the covariances of negative observations.
  • apaCovars.Semi.NonConcordantCalculates the semi-non-concordant covariance matrix from time series data, i.e. the covariances of observations moving in opposite directions.
  • apaCovars.Semi.PosCalculates the semi-positive covariance matrix from time series data, i.e. the covariances of positive observations.
  • apaCovars.ShrinkShrinks a covariance matrix towards the average covariance matrix, with different amounts of shrinkage for volatilities and correlations.

apaCSVDates 1

  • apaCSVDatesReads the date column from an external CSV time series file.

apaCSVNames 1

  • apaCSVNamesReads the time series names from an external CSV time series file.

apaCSVTimeSeries 1

  • apaCSVTimeSeriesReads the time series data from an external CSV time series file.

apaCVaG 1

  • apaCVaG.EmpiricalCalculates the empirical conditional value at gain (CVaG) from a time series matrix of returns.

apaCVaR 7

  • apaCVaR.EmpiricalCalculates the empirical (historical) conditional value at risk (CVaR) from a time series matrix of returns.
  • apaCVaR.NormalCalculates the parametric normal conditional value at risk (CVaR) of a return time series.
  • apaCVaR.Normal.FromConstituentsCalculates the ex ante parametric normal conditional value at risk (CVaR) of a portfolio from constituent weights and returns.
  • apaCVaR.Normal.MomentsCalculates the parametric normal conditional value at risk (CVaR) from the mean and the volatility.
  • apaCVaR.ModifiedCalculates the modified conditional value at risk (modified CVaR) of a return time series.
  • apaCVaR.Modified.FromConstituentsCalculates the parametric modified conditional value at risk (modified CVaR) of a portfolio from constituent weights and returns.
  • apaCVaR.Modified.MomentsCalculates the modified conditional value at risk (modified CVaR) from moments.

D

apaDaR 2

apaData 27

apaDCC 2

  • apaDCC.GARCH.11.EstimateEstimates a DCC‑GARCH(1,1) model with internal univariate GARCH(1,1) estimation and returns model diagnostics, per‑series GARCH parameters, the latest conditional correlation and covariance…
  • apaDCC.GARCH.11.ForecastReturns out-of-sample DCC-GARCH(1,1) correlation forecasts for the requested forecast horizons, expressed as vecl representations of the forecast correlation matrices.

apaDecisionTree 9

apaDependence 1

  • apaDependence.Empirical.LowerCalculates the empirical lower (left) tail dependence, i.e. the probability that Y is below the threshold given that X is below the threshold.

apaDetrend 6

apaDistances 20

apaDiversificationChart 5

apaDiversificationRatio 1

  • apaDiversificationRatioCalculates the diversification ratio (Choueifaty/Coignard), i.e. the weighted average constituent volatility divided by the portfolio volatility.

apaDRatio 1

  • apaDRatioReturns the d-ratio, the ratio of the total size of losses to the total size of gains, each weighted by its number of occurrences.

apaDrawdowns 11

E

apaEigenvalues 5

  • apaEigenvaluesCalculates the eigenvalues of a symmetric matrix.
  • apaEigenvalues.DiagonalCalculates the eigenvalues of a symmetric matrix and returns them on the main diagonal of an n x n matrix of zeros.
  • apaEigenvalues.SortedCalculates the eigenvalues of a symmetric matrix, sorted in descending order (largest eigenvalue first).
  • apaEigenvalues.Sorted.PercentCalculates the eigenvalues of a symmetric matrix as percentages of their sum, sorted in descending order (largest eigenvalue first).
  • apaEigenvalues.Sorted.Percent.CumulativeCalculates the cumulative percentage eigenvalues of a symmetric matrix, sorted in descending order (largest eigenvalue first).

apaEigenvectors 2

  • apaEigenvectorsCalculates the eigenvectors of a symmetric matrix.
  • apaEigenvectors.SortedCalculates the eigenvectors of a symmetric matrix, sorted by their eigenvalues (largest eigenvalue first).

apaElasticGradientDescentRegression 1

apaEmpCdf 3

  • apaEmpCdfCalculates the empirical cumulative distribution function (cdf) from time series data.
  • apaEmpCdf.FromValueCalculates the empirical cumulative distribution function (cdf) of a single value, given a vector of observations.
  • apaEmpCdf.ConfidenceBandsCalculates the empirical cumulative distribution function (cdf) with upper and lower confidence bands from a time series data vector.

apaEmpInv 1

  • apaEmpInvInverse empirical cumulative distribution function.

apaEntropy 1

apaEVT 1

apaExcessReturnOnVaR 1

  • apaExcessReturnOnVaRCalculates the excess return on value at risk, a risk-adjusted performance measure, i.e. the average excess return divided by the absolute VaR.

apaExponentialWeights 1

  • apaExponentialWeightsGenerates a vector of exponential weights of a certain length with a certain half-life.

F

apaFactorModel 4

  • apaFactorModel.AssetCorrelsCalculates the asset correlation matrix implied by a factor model from betas, residual variances and factor covariances.
  • apaFactorModel.AssetCovarsCalculates the asset covariance matrix implied by a factor model from betas, residual variances and factor covariances.
  • apaFactorModel.AssetReturnsCalculates the expected asset returns implied by a factor model from betas, residual returns and factor returns.
  • apaFactorModel.AssetVariancesCalculates the total asset variances implied by a factor model from betas, residual variances and factor covariances.

apaFarinelliTibilettiRatio 1

  • apaFarinelliTibilettiRatioCalculates the Farinelli-Tibiletti ratio, a risk-adjusted performance measure, i.e. the ratio of the upper and lower partial moments of given degrees.

apaFirstPassageTime 2

G

apaGainLossSpread 1

  • apaGainLossSpreadCalculates the gain-loss spread, a risk measure, i.e. the average return at or above the threshold minus the average return below the threshold.

apaGainToPainRatio 1

  • apaGainToPainRatioReturns the gain-to-pain ratio, the sum of all returns divided by the sum of losses.

apaGARCH11 6

apaGeneralizedRachevRatio 1

  • apaGeneralizedRachevRatioCalculates the generalized Rachev ratio, a risk-adjusted performance measure, i.e. CVaG^UpperPower divided by CVaR^LowerPower.

apaGiniMeanDifference 1

  • apaGiniMeanDifferenceCalculates the Gini mean difference, i.e. the average absolute difference between all pairs of observations.

apaGPcdf 1

  • apaGPcdfCumulative distribution function of the generalized Pareto distribution.

apaGPest 1

  • apaGPestEstimates the scale parameter sigma and the shape parameter eta of the generalized Pareto distribution by maximum likelihood, for non-negative exceedances.

apaGPinv 1

  • apaGPinvInverse cumulative distribution function of the generalized Pareto distribution.

apaGPpdf 1

  • apaGPpdfProbability density function of the generalized Pareto distribution.

apaGPrnd 1

  • apaGPrndReturns a random drawing from a generalized Pareto distribution.

apaGPsim 1

  • apaGPsimSimulates random drawings from a generalized Pareto distribution.

apaGraph 71

H

apaHalflifeToLambda 1

  • apaHalflifeToLambdaConverts a half-life into the corresponding exponential decay factor lambda.

apaHenrikssonMerton 2

apaHerfindahlIndex 2

  • apaHerfindahlIndexCalculates the Herfindahl (Herfindahl-Hirschman) index, a measure of concentration.
  • apaHerfindahlIndex.NormalizedCalculates the normalized Herfindahl (Herfindahl-Hirschman) index, a measure of concentration between zero and one.

apaHistogram 1

  • apaHistogramPrepares the inputs to draw a histogram and returns rich information to characterize empirical distributions:

apaHPFilter 2

  • apaHPFilterApplies the Hodrick-Prescott filter to a time series and returns the trend component.
  • apaHPFilter.BoostedApplies the boosted Hodrick-Prescott filter to a time series and returns the trend component.

apaHull 1

  • apaHull.ConvexSelects the points of a set of two-dimensional observations (X,Y) which constitute the convex hull.

apaHurstExponent 1

  • apaHurstExponentCalculates the Hurst exponent (rescaled range analysis), an indicator whether a time series exhibits mean reversion or momentum.

I

apaIchimoku 1

apaImputation 14

apaInformationRatio 2

apaIsAutocorrelatedLjungBox 1

apaIsMeanDifferentFrom 1

  • apaIsMeanDifferentFromTwo-sided t-test whether the mean of a data series statistically differs from a reference value.

apaIsNormalJB 1

  • apaIsNormalJBJarque-Bera test whether a time series is normally distributed.

apaIsStructuralBreakChow 1

apaIsUnitRootADF 1

apaIsValidAllocation 3

apaIsValidCF 1

  • apaIsValidCFIndicates whether a pair of skewness and excess kurtosis parameters results in a valid Cornish-Fisher expansion.

apaIsValidNIG 1

  • apaIsValidNIGIndicates whether a pair of skewness and kurtosis (not excess kurtosis) values results in a valid NIG distribution.

apaIVaR 1

  • apaIVaR.Empirical.DiscreteCalculates the empirical interim value at risk (interim VaR) at a given confidence level from a time series matrix of returns.

J

apaJensenAlpha 1

  • apaJensenAlphaCalculates Jensen’s alpha, a risk-adjusted performance measure.

K

apaKappa3 1

  • apaKappa3Calculates the Kappa 3 ratio, a risk-adjusted performance measure, i.e. the average return in excess of the threshold divided by the cube root of the third lower partial moment.

apakNearestNeighbour 11

apaKnee 1

  • apaKneeFinds the knee (or elbow) of a data vector, i.e. the observation with the largest distance to the line between the first and the last observation.

apaKurtosis 5

  • apaKurtosis.ExpWeightedCalculates the exponentially weighted excess kurtosis (kurtosis minus 3) of each series of a time series matrix.
  • apaKurtosis.ConfidenceIntervalsCalculates the confidence intervals for the sample excess kurtosis (as the Excel function KURT) using a resampling methodology.
  • apaKurtosis.FromReturnsCalculates the portfolio kurtosis (not excess kurtosis) from the constituent weights and returns, using population moments.
  • apaKurtosis.FromCokurtsCalculates the portfolio kurtosis (not excess kurtosis) from the constituent weights, the covariance matrix and the cokurtosis matrix.
  • apaKurtosis.PopulationCalculates the population excess kurtosis (population version of the Excel function KURT).

L

apaLambdaToHalflife 1

  • apaLambdaToHalflifeConverts an exponential decay factor lambda into the corresponding half-life.

apaLarg 1

  • apaLargDerives the location and scale parameters of the logistic distribution from its mean and volatility.

apaLayers 2

  • apaLayers.Convex.InnerDataReturns the inner data of a two-dimensional dataset (X,Y), defined by convex layers and a percentile threshold.
  • apaLayers.Convex.OuterDataReturns the outer data of a two-dimensional dataset (X,Y), defined by convex layers and a percentile threshold.

apaLayout 4

  • apaLayout.FromGridDerives an (X,Y) layout (grid) from lower and upper bounds for X and Y.
  • apaLayout.MatchInterpolates two 2D objects linearly such that they have the same number of points.
  • apaLayout.MorphInterpolates between two 2D objects from 0% (first object) to 100% (second object).
  • apaLayout.TransformTransforms a 2D layout: scaling, rotation, horizontal and vertical flipping, jitter and shear.

apaLcdf 1

  • apaLcdfCumulative distribution function of the logistic distribution.

apaLicense 8

apaLinv 1

  • apaLinvInverse cumulative distribution function of the logistic distribution.

apaLmom 1

  • apaLmomDerives the moments of the logistic distribution from its location and scale parameters.

apaLogisticFunction 5

apaLognormalToNormal 4

apaLongfallProb 1

  • apaLongfallProb.EmpiricalCalculates empirical longfall probabilities from a time series matrix of returns, i.e. the probabilities of returns at or above a certain threshold.

apaLoss 5

  • apaLoss.CdfReturns the sorted losses relative to a threshold and their empirical cumulative distribution.
  • apaLoss.MeanExcessReturns the mean excess loss below the threshold.
  • apaLossReturns all losses, i.e. returns below the threshold.
  • apaLoss.SortedReturns all losses, i.e. returns below the threshold, sorted in ascending order.
  • apaLoss.CountExcessCounts the number of losses below the threshold.

apaLpdf 1

  • apaLpdfProbability density function of the logistic distribution.

apaLPM 1

  • apaLPMCalculates the lower partial moment (LPM) of a return time series.

M

apaMACD 1

  • apaMACDCalculates the moving average convergence/divergence (MACD) technical indicator.

apaMAD 3

  • apaMAD.DownsideCalculates the downside mean absolute deviation of each series of a return matrix.
  • apaMAD.MeanCalculates the mean absolute deviation from the arithmetic mean.
  • apaMAD.MedianCalculates the mean absolute deviation from the median.

apaMagnitudeSurprise 1

  • apaMagnitudeSurpriseCalculates the magnitude surprise (Kinlaw/Turkington), i.e. the turbulence ignoring correlations, for each observation.

apaManual 1

apaMarchenkoPasturPDF 1

  • apaMarchenkoPasturPDFProbability density function of the Marchenko-Pastur distribution, i.e. the theoretical distribution of the eigenvalues of a random correlation matrix.

apaMarkov 27

apaMatrix 112

apaMean 1

apaMeanCDaR 3

  • apaMeanCDaR.AssetsReturns a 2 x nAssets matrix with the average return of each asset in the first row and its conditional drawdown at risk (CDaR) in the second row.
  • apaMeanCDaR.Restricted.Bounded.Axb.FrontierCalculates the restricted and bounded mean-CDaR efficient frontier for a given confidence level, with optional additional linear equality and inequality constraints.
  • apaMeanCDaR.Restricted.Bounded.FrontierCalculates the restricted and bounded mean-CDaR efficient frontier for a given confidence level, using drawdowns of cumulative uncompounded returns.

apaMeanCVaR 6

apaMeanMAD 4

apaMeanMADD 4

apaMeanMADTD 4

apaMeanML 4

apaMeanVariance 48

apaModifiedSharpeRatio 1

  • apaModifiedSharpeRatioCalculates the modified Sharpe ratio, i.e. the average excess return divided by the modified value at risk (VaR).

apaModifiedZScore 2

  • apaModifiedZScoreCalculates modified z-scores, i.e. deviations from the median in units of the median absolute deviation (MAD).
  • apaModifiedZScore.OutlierFlags outliers based on modified z-scores: * for |z| >= 1, ** for |z| >= 2 and *** for |z| >= 3.

apaModigliani 1

  • apaModigliani.M2Returns the Modigliani risk-adjusted performance M², i.e. the return the portfolio would have earned at the volatility of the benchmark.

apaMoments 4

apaMPPM 1

  • apaMPPMReturns the manipulation-proof performance measure (MPPM), an annualized certainty-equivalent excess log return under power utility.

apaMultinomialLogit 1

  • apaMultinomialLogit.EstimateEstimates a multinomial logistic regression model by maximum likelihood and returns diagnostics, coefficients and in-sample predictions.

N

apaNaturalSpline 1

apaNcdf 1

  • apaNcdfCumulative distribution function of the normal distribution, evaluated elementwise for a matrix of values.

apaNChooseK 3

apaNelsonSiegel 5

apaNelsonSiegelSvensson 4

apaNIGarg 2

  • apaNIGargReturns the parameters alpha, beta, mu and delta (4 x 1, in this order) of the normal inverse Gaussian (NIG) distribution with the given mean, variance, skewness and kurtosis.
  • apaNIGarg.randomizedReturns a set of random NIG parameters implied by moments drawn randomly between lower and upper bounds.

apaNIGcdf 1

  • apaNIGcdfCumulative distribution function of the normal inverse Gaussian (NIG) distribution.

apaNIGest 1

  • apaNIGestEstimates the NIG parameters alpha, beta, mu and delta for each time series by moment matching.

apaNIGinv 1

  • apaNIGinvInverse cumulative distribution function of the normal inverse Gaussian (NIG) distribution.

apaNIGmom 1

  • apaNIGmomReturns the first four moments implied by the four parameters of the normal inverse Gaussian (NIG) distribution: mean, variance, skewness and kurtosis (not excess kurtosis).

apaNIGpdf 1

  • apaNIGpdfProbability density function of the normal inverse Gaussian (NIG) distribution.

apaNIGrnd 1

  • apaNIGrndReturns a random value drawn from a normal inverse Gaussian (NIG) distribution.

apaNIGsim 3

  • apaNIGsimReturns a vector of random values drawn from a normal inverse Gaussian (NIG) distribution.
  • apaNIGsim.randomizedReturns a vector of random values drawn from a NIG distribution with randomized moments, drawn between lower and upper bounds, and a randomized first order autocorrelation.
  • apaNIGsim.CorrelatedSimulates correlated normal inverse Gaussian (NIG) distributed random variables whose Pearson correlations equal the target correlations.

apaNinv 1

  • apaNinvInverse cumulative distribution function of the normal distribution.

apaNN 1

  • apaNN.MLPClassifier.EstimateEstimates a multiclass neural network classifier with one hidden layer (multilayer perceptron, MLP) and returns diagnostics, parameters and in-sample predictions.

apaNonNormality 2

  • apaNonNormality.ContributionsCalculates the incremental contributions of all observations of a time series to non-normality, i.e. to the Jarque-Bera test statistic.
  • apaNonNormality.nObsToDropUntilNormalCalculates the number of observations with large contributions to non-normality which need to be dropped until a time series passes the Jarque-Bera test for normality, divided by the total number…

apaNormalMixture 4

  • apaNormalMixture.EstimateEstimates a multivariate Gaussian mixture model with the multi-start EM algorithm and returns the component parameters and the per-sample responsibilities.
  • apaNormalMixture.MomentsReturns the means, volatilities, skewness, excess kurtosis and correlations of a normal mixture distribution with any number of components.
  • apaNormalMixture.ResponsibilitiesReturns the component responsibilities (posterior mixture weights) of each observation under an estimated Gaussian mixture model.
  • apaNormalMixture.StateTrajectoryReturns the most probable mixture component index for each observation.

apaNormalQQ 2

  • apaNormalQQ.CorrelCalculates the normal probability plot correlation coefficient, a test for normality, i.e. the correlation between the empirical cumulative distribution and the cumulative probabilities of a…
  • apaNormalQQ.PlotCalculates the data for a normal QQ plot, i.e. the sorted observations and the corresponding quantiles of a normal distribution with the same mean and standard deviation.

apaNormalToLognormal 4

apaNpdf 1

apaNsim 2

  • apaNsimReturns time series of random numbers drawn from a normal distribution.
  • apaNsim.MultivariateSimulates random values from a multivariate normal distribution.

O

apaOLS 21

  • apaOLS.FittedReturns the fitted Y values of an OLS regression.
  • apaOLS.BetasReturns the ordinary least squares (OLS) regression coefficients (betas).
  • apaOLS.Betas.ConfidenceIntervalsReturns confidence intervals for the OLS regression coefficients (betas) based on resampling.
  • apaOLS.ForwardStagewisePerforms an incremental forward stagewise linear regression for nSteps steps and returns the coefficient path: a matrix of nSteps rows and 2 + columns(X) columns.
  • apaOLS.kFoldPerforms a k-fold OLS estimation.
  • apaOLS.Betas.EvaluationReturns the standard errors, t-values, two-sided critical t-values and two-sided p-values of the OLS regression coefficients.
  • apaOLS.Betas.CriticalValueReturns the two-sided critical t-values of the OLS regression coefficients.
  • apaOLS.Betas.tValueReturns the t-values of the OLS regression coefficients.
  • apaOLS.Betas.pValueReturns the two-sided p-values of the OLS regression coefficients (null hypothesis: coefficient = 0).
  • apaOLS.Betas.StandardErrorReturns the standard errors of the OLS regression coefficients.
  • apaOLS.FtestPerforms an F-test of the regression model.
  • apaOLS.R2Returns the R-squared of an OLS regression.
  • apaOLS.R2.ConfidenceIntervalsReturns resampled confidence intervals for the R-squared of an OLS regression.
  • apaOLS.R2.AdjustedReturns the R-squared of an OLS regression, adjusted for the number of variables.
  • apaOLS.Ridge.BetasEstimates the betas of a linear ridge regression.
  • apaOLS.Ridge.kFoldPerforms a k-fold linear ridge regression estimation.
  • apaOLS.ResidualsReturns the residuals of an OLS regression.
  • apaOLS.SSECalculates the sum of squares error (SSE), i.e. the sum of squared deviations of the fitted Y values from the observed Y values.
  • apaOLS.SSRCalculates the sum of squares regression (SSR), i.e. the sum of squared deviations of the fitted Y values from the mean of Y.
  • apaOLS.SSTCalculates the sum of squares total (SST), i.e. the sum of squared deviations of the Y values from the mean of Y.
  • apaOLS.StepwisePerforms a forward stepwise linear regression with an intercept and returns the full selection path: a matrix with columns(X) rows and 2 x columns(X) + 4 columns, one row per step.

apaOmega 1

  • apaOmegaCalculates the Omega ratio, a risk-adjusted performance measure, i.e. 1 + the average return in excess of the threshold divided by the first lower partial moment.

apaOneHotEncoding 1

P

apaPainIndex 1

  • apaPainIndexReturns the pain index, the mean depth of the drawdowns over all periods.

apaPainRatio 1

  • apaPainRatioReturns the pain ratio, the mean excess return divided by the pain index.

apaPartialAutoCorrel 1

  • apaPartialAutoCorrelReturns the partial autocorrelation coefficients up to a certain lag, optionally with approximate 95% confidence bands ±2/√n, where n is the number of observations.

apaPatternRecognition 24

apaPcdf 1

  • apaPcdfCumulative distribution function of the Poisson distribution, i.e. the probability of at most k events.

apaPercentile 2

  • apaPercentilePercentile function (as the Excel function PERCENTILE), i.e. returns the data point which constitutes a certain percentile.
  • apaPercentile.InverseInverse percentile function (inverse of the Excel function PERCENTILE), i.e. returns the percentile (cumulative probability) of a data point X in the dataset.

apaPiecewiseRegression 6

apaPinv 1

  • apaPinvInverse cumulative distribution function of the Poisson distribution, i.e. the smallest number of events k with a probability of at most k events of at least Prob.

apaPolygon 3

  • apaPolygon.ConcaveSelects the points of a set of two-dimensional observations (X,Y) which constitute the concave polygon around the dataset.
  • apaPolygon.ConvexSelects the points of a set of two-dimensional observations (X,Y) which constitute the convex polygon around the dataset.
  • apaPolygon.Regular.LayoutReturns the layout of a regular polygon with given center coordinates and number of corners.

apaPolynomial 1

apaPortfolio 3

apaPpdf 1

  • apaPpdfProbability mass function of the Poisson distribution, i.e. the probability of exactly k events.

apaPriceSim 6

  • apaPriceSim.BBSimulates prices which follow a Brownian bridge, i.e. a geometric Brownian motion with a deterministic ending value.
  • apaPriceSim.GBMSimulates prices which follow a geometric Brownian motion.
  • apaPriceSim.MNSimulates prices which follow a normal mixture process.
  • apaPriceSim.JDLNSimulates prices which follow a jump-diffusion process with lognormally distributed jumps (Hull).
  • apaPriceSim.GARCH11Simulates prices which follow a GARCH(1,1) process.
  • apaPriceSim.ARMA22Simulates prices which follow an ARMA(2,2) process.

apaPrivateMarkets 6

apaPrnd 1

  • apaPrndReturns a random number drawn from a Poisson distribution, i.e. a random number of events.

apaProfitFactor 1

  • apaProfitFactorReturns the profit factor, the sum of gains divided by the sum of losses.

apaProspectRatio 1

  • apaProspectRatioReturns the prospect ratio, a downside-risk ratio that weights losses more heavily than gains, as in prospect theory.

apaPsim 1

  • apaPsimReturns a vector of random numbers drawn from a Poisson distribution, i.e. random numbers of events.

Q

apaQuantileRegression 1

  • apaQuantileRegression.BetasEstimates the coefficients of a quantile regression of Y on the X variables for a given quantile (intercept first).

R

apaRachevRatio 1

  • apaRachevRatioCalculates the Rachev ratio, a risk-adjusted performance measure, i.e. the conditional value at gain (CVaG) divided by the conditional value at risk (CVaR).

apaRandomForest 6

apaRandomWeights 3

apaRating 2

apaRegimes 2

apaRegression 5

apaRegressogram 1

  • apaRegressogramRegressogram, a non-parametric method for estimating a regression function, i.e. the regression analogue of a histogram: the mean of Y within bins of X.

apaReplicateRiskReturn 1

  • apaReplicateRiskReturnGenerates random return time series with a given number of observations which exactly replicate given vectors of expected returns and volatilities and a given correlation matrix.

apaResample 4

apaResidualRisk 1

  • apaResidualRiskCalculates the residual risk, i.e. the volatility of the residuals of a single-index (one-factor) model, a measure of tracking error.

apaReturn 10

apaReturns 33

apaRuns 2

  • apaRuns.LosingReturns the losing runs, i.e. the cumulative losses of consecutive negative returns.
  • apaRuns.WinningReturns the winning runs, i.e. the cumulative gains of consecutive positive returns.

S

apaSharpeRatio 7

  • apaSharpeRatioReturns the Sharpe ratio of a portfolio, a risk-adjusted performance measure.
  • apaSharpeRatio.FromConstCalculates the Sharpe ratio of a constant-weight portfolio from constituent excess returns.
  • apaSharpeRatio.Annualized.LoReturns the annualized Sharpe ratio of excess returns, adjusted for serial correlation.
  • apaSharpeRatio.DeflatedReturns the deflated Sharpe ratio (DSR): the probabilistic Sharpe ratio measured against the Sharpe ratio expected from the best of several unskilled strategies, correcting for selection bias…
  • apaSharpeRatio.MinTrackRecordLengthReturns the minimum track record length (MinTRL): the number of observations needed to conclude, at the given confidence level, that the true Sharpe ratio exceeds the benchmark Sharpe ratio.
  • apaSharpeRatio.ProbabilisticReturns the probabilistic Sharpe ratio (PSR): the probability that the true per-period Sharpe ratio exceeds a benchmark Sharpe ratio, allowing for skewness and fat tails.
  • apaSharpeRatio.StandardErrorReturns the standard error of the per-period Sharpe ratio of excess returns for non-normal, serially independent returns.

apaShortfallProb 2

apaShrinkageEstimator 7

apaSimilarities 3

apaSingleIndexModel 5

apaSkewness 5

  • apaSkewness.ConfidenceIntervalsCalculates confidence intervals for skewness, the third standardized central moment, using a resampling methodology.
  • apaSkewness.ExpWeightedReturns the exponentially weighted skewnesses of a time series matrix, one skewness estimate per input series.
  • apaSkewness.FromReturnsCalculates portfolio skewness from a constituent weight vector and a constituent return matrix.
  • apaSkewness.FromCoskewsCalculates portfolio skewness from a constituent weight vector, a covariance matrix and a coskewness matrix.
  • apaSkewness.PopulationReturns the population skewness, i.e. a population version of the Excel function SKEW.

apaSortinoRatio 1

  • apaSortinoRatioReturns the Sortino ratio, a risk-adjusted performance measure.

apaSpeed 2

  • apaSpeed.GetReturns the current calculation speed level: 1 (accurate), 2 (balanced) or 3 (fast).
  • apaSpeed.SetSets the calculation speed level and returns the level set.

apaSplitFactors 1

  • apaSplitFactorsCreates an r x nStocks table of stock split conversion factors, one row per date and one column per stock ID.

apaSSA 9

  • apaSSA.SignalReturns the signal of a singular spectrum analysis (SSA) of time series data, reconstructed from the leading components.
  • apaSSA.Signal.ForecastReturns forecasts (forward linear prediction) of the signal of a singular spectrum analysis (SSA) of time series data.
  • apaSSA.Signal.RedrawnRecalculates the singular spectrum analysis (SSA) signal on expanding windows, showing how the signal is redrawn when new observations arrive.
  • apaSSA.ComponentsReturns the component signal matrix of a singular spectrum analysis (SSA) of time series data.
  • apaSSA.Components.ForecastReturns forecasts (forward linear prediction) of the components of a singular spectrum analysis (SSA) of time series data.
  • apaSSA.SpectrumReturns the spectrum of a singular spectrum analysis (SSA) of time series data, i.e. the sorted eigenvalues of all components.
  • apaSSA.Spectrum.PercentReturns the spectrum of a singular spectrum analysis (SSA) of time series data, with eigenvalues expressed as percentage figures.
  • apaSSA.Spectrum.Percent.CumReturns the spectrum of a singular spectrum analysis (SSA) of time series data, with eigenvalues expressed as cumulative percentage figures.
  • apaSSA.wCorrelsReturns the w-correlation matrix of the components of a singular spectrum analysis (SSA) of time series data.

apaStatFactors 7

  • apaStatFactors.PortfolioRisksReturns the total portfolio variance, the systematic variance based on a statistical factor model and the residual variance of a portfolio with given constituent weights.
  • apaStatFactors.FactorWeightsReturns the factor exposures of a portfolio based on a statistical factor model derived from the constituent returns.
  • apaStatFactors.ResidualsReturns the residual returns of a statistical factor model derived from the constituent returns.
  • apaStatFactors.FactorsReturns the factor return time series of a statistical factor model derived from the constituent returns.
  • apaStatFactors.BetasReturns the factor betas of a statistical factor model derived from the constituent returns.
  • apaStatFactors.AlphasReturns the factor alphas in a statistical factor model derived from the portfolio constituent returns.
  • apaStatFactors.VarianceExplainedReturns the sorted % of variance explained by each statistical factor, the cumulative % explained, the Eigenvalue of the factor and the factor index.

apaSterlingRatio 1

  • apaSterlingRatioReturns the Sterling ratio, a risk-adjusted performance measure, i.e. the average excess return divided by the absolute average depth of the nDrawdowns largest drawdown episodes.

apaStochasticDominance 1

  • apaStochasticDominanceReturns TRUE if Returns1 stochastically dominates Returns2 of the given order, FALSE otherwise.

apaStrategy 1

  • apaStrategy.CPPIReturns the value path of a CPPI (constant proportion portfolio insurance) strategy applied to a series of risky asset returns.

apaStresstest 2

  • apaStresstest.CovarsReturns a bootstrap stress-tested covariance matrix from a return data matrix: the elementwise maximum, average and minimum covariances across the bootstrap samples.
  • apaStresstest.ExpectedReturnsReturns bootstrap stressed expected returns: the worst, base and best expected return vectors, stacked vertically.

apaSummary 4

apaSystem 3

T

apaTailDependence 3

  • apaTailDependence.LReturns the left tail dependence, i.e. the conditional probability of joint occurrences up to a given quantile.
  • apaTailDependence.RReturns the right tail dependence, i.e. the conditional probability of joint occurrences above a given quantile.
  • apaTailDependence.LRReturns the combined left and right tail dependence, i.e. the conditional probability of joint occurrences.

apaTailRatio 1

  • apaTailRatioReturns the tail ratio, the size of the right tail of the return distribution relative to the left tail.

apaTcdf 1

  • apaTcdfCumulative distribution function of Student’s t distribution.

apaTemporal 18

apaTimePoints 2

  • apaTimePoints.FromDatesCalculates points in time, i.e. the time that has passed from the beginning of StartDate to each date, as a fraction of the period from the beginning of StartDate to the end of EndDate (Act/Act).
  • apaTimePoints.RoundedRounds a vector of time points to the nearest multiple of 1/nPeriods, i.e. such that the overall time period is divided into nPeriods subperiods of equal length.

apaTinv 1

  • apaTinvInverse of the cumulative distribution function of Student’s t distribution.

apaTpdf 1

  • apaTpdfProbability density function of Student’s t distribution.

apaTrackingError 4

apaTradeProfile 8

  • apaTradeProfile.CDaRCalculates the so-called “trade profile” of portfolio conditional drawdown at risk (CDaR), i.e. how +/- changes in the constituent exposures affect the portfolio CDaR.
  • apaTradeProfile.CVaRCalculates the so-called “trade profile” of portfolio conditional value at risk (CVaR), i.e. how +/- changes in the constituent exposures affect the portfolio CVaR.
  • apaTradeProfile.DaRCalculates the so-called “trade profile” of portfolio drawdown at risk (DaR), i.e. how +/- changes in the constituent exposures affect the portfolio DaR.
  • apaTradeProfile.KurtosisCalculates the so-called “trade profile” of portfolio kurtosis, i.e. how +/- changes in the constituent exposures affect the portfolio kurtosis.
  • apaTradeProfile.SharpeRatioCalculates the so-called “trade profile” of the portfolio Sharpe ratio, i.e. how +/- changes in the constituent exposures affect the portfolio Sharpe ratio.
  • apaTradeProfile.SkewnessCalculates the so-called “trade profile” of portfolio skewness, i.e. how +/- changes in the constituent exposures affect the portfolio skewness.
  • apaTradeProfile.VaRCalculates the so-called “trade profile” of portfolio value at risk (VaR), i.e. how +/- changes in the constituent exposures affect the portfolio VaR.
  • apaTradeProfile.VolatilityCalculates the so-called “trade profile” of portfolio volatility, i.e. how +/- changes in the constituent exposures affect the portfolio volatility.

apaTree 1

apaTrendModels 4

  • apaTrendModels.FourierFits a Fourier harmonic trend regression with intercept to a single series and returns the fitted values and coefficients.
  • apaTrendModels.NeuralNetworkFits a neural network forecast model with lagged inputs, trained with the Adam optimizer and early stopping, and calculates a recursive multi-step forecast.
  • apaTrendModels.PiecewiseFits a piecewise linear or quadratic trend model to a single series, selects the number of breakpoints by a knee rule and returns the fitted values and breakpoint information.
  • apaTrendModels.PolynomialFits a polynomial time trend regression with intercept to a single series and returns the fitted values and coefficients.

apaTreynorMazui 2

  • apaTreynorMazui.AlphaReturns the alpha of a portfolio based on the Treynor/Mazuy quadratic one-factor (market-timing) model.
  • apaTreynorMazui.GammaReturns the gamma of a portfolio, a market timing indicator, based on the Treynor/Mazuy quadratic one-factor model.

apaTreynorRatio 1

  • apaTreynorRatioReturns the Treynor ratio, a risk-adjusted performance measure.

apaTriangCdf 1

  • apaTriangCdfCumulative distribution function of the triangular distribution.

apaTriangInv 1

  • apaTriangInvInverse cumulative distribution function of the triangular distribution.

apaTriangMom 1

  • apaTriangMomReturns the first four moments of a triangular distribution: mean, variance, skewness and kurtosis (not excess kurtosis).

apaTriangPdf 1

  • apaTriangPdfProbability density function of the triangular distribution.

apaTriangRnd 1

  • apaTriangRndReturns a random number drawn from a triangular distribution.

apaTriangSim 1

  • apaTriangSimReturns a vector of random numbers drawn from a triangular distribution.

apaTsim 2

  • apaTsimReturns a matrix of random numbers drawn from Student’s t distributions with given location and scale parameters.
  • apaTsim.MultivariateReturns random drawings from a multivariate Student’s t distribution.

apaTurbulence 1

  • apaTurbulenceCalculates the financial turbulence indicator (Kritzman/Li), i.e. the Mahalanobis distance of the returns from their mean, for each observation.

apaTurnover 1

  • apaTurnoverCalculates the turnover between two allocations.

U

apaUlcerIndex 1

  • apaUlcerIndexCalculates the Ulcer Index, a risk measure, i.e. the root mean square of the underwater returns.

apaUlcerPerformanceIndex 1

apaUPM 1

  • apaUPMReturns the upper partial moment (UPM) of a return time series.

apaUpsidePotentialRatio 1

apaUsim 2

  • apaUsimReturns a vector of random drawings from a uniform distribution between 0 and 1.
  • apaUsim.CorrelatedSimulates correlated uniformly distributed random variables (Gaussian copula).

V

apaVaR 12

  • apaVaR.EVT.HillCalculates value at risk (VaR) based on extreme value theory, using the Hill tail index estimate.
  • apaVaR.EVT.GPCalculates value at risk (VaR) based on extreme value theory, from a generalized Pareto distribution fitted to the losses beyond the threshold.
  • apaVaR.EmpiricalReturns the empirical value at risk (VaR) of each return series.
  • apaVaR.ModifiedReturns the modified value at risk (VaR), an approximate parametric VaR figure based on the Cornish-Fisher expansion.
  • apaVaR.Modified.FromConstituentsReturns the parametric modified value at risk (VaR) of a portfolio, calculated from constituent weights and returns.
  • apaVaR.Modified.MomentsReturns the modified value at risk (VaR), an approximate parametric VaR figure based on the Cornish-Fisher expansion, calculated from moments.
  • apaVaR.Modified.AttributionPerforms a tail risk attribution of modified value at risk (VaR) to the portfolio constituents.
  • apaVaR.NIGReturns the parametric normal inverse Gaussian (NIG) value at risk (VaR).
  • apaVaR.NormalReturns the parametric normal value at risk (VaR) of a return time series.
  • apaVaR.Normal.FromConstituentsReturns the ex ante parametric normal value at risk (VaR) of a portfolio, calculated from constituent weights and returns.
  • apaVaR.Normal.MomentsReturns the parametric normal value at risk (VaR), calculated from moments.
  • apaVaR.GARCH11.ConditionalReturns the value at risk (VaR) calculated from the conditional volatility of a fitted GARCH(1,1) model.

apaVectorAutoregress 11

apaVersion 2

apaVolatilities 12

apaVolatility 8

  • apaVolatility.ExpWeighted.HalfLife.CalibrateCalibrate the half‑life of an exponentially weighted volatility model by minimizing out‑of‑sample forecast loss, optionally across multiple return series in one call.
  • apaVolatility.ConfidenceIntervalsCalculates confidence intervals for volatility, the square root of the second central moment, using a resampling methodology.
  • apaVolatility.FromCovarsCalculates portfolio volatilities from weights and a covariance matrix.
  • apaVolatility.FromReturnsCalculates portfolio volatilities from weights and constituent returns.
  • apaVolatility.DownsideCalculates the downside volatility of each column of a return matrix, i.e. the square root of the second lower partial moment with respect to the threshold.
  • apaVolatility.LowerCalculates the lower semi-volatility of a return series, i.e. the square root of the second lower partial moment with respect to the mean.
  • apaVolatility.UpperCalculates the upper semi-volatility of a return series, i.e. the square root of the second upper partial moment with respect to the mean.
  • apaVolatility.UpsideCalculates the upside volatility of each column of a return matrix, i.e. the square root of the second upper partial moment with respect to the threshold.

W

apaWealthSimulation 1

  • apaWealthSimulationMonte Carlo wealth simulation with cash flows and time-varying risk and return.

apaWeights 8

  • apaWeights.BuyAndHoldReturns a matrix containing the evolution of buy and hold weights, i.e. initial weights drifting with the constituent returns.
  • apaWeights.Combinatorial.EqualWeightedReturns the allocations of all possible portfolios containing nAssetsInPortfolio equally weighted assets selected from a universe of nAssetsInUniverse assets.
  • apaWeights.Combinatorial.TwoAssetsReturns nAllocations allocations of all possible two-asset portfolios selected from a universe of nAssetsInUniverse assets.
  • apaWeights.FromAllocationsCalculates the weights over time from target allocations, letting the weights drift with the constituent returns between allocation dates.
  • apaWeights.RebalancedReturns a matrix containing the evolution of weights which are regularly rebalanced to the initial weights.
  • apaWeights.StyleReturns the style weights best replicating a portfolio return time series.
  • apaWeights.Style.RollingReturns the rolling style weights best replicating a portfolio return time series.
  • apaWeights.Tilt.CategoryTilts a portfolio either towards the first category (positive tilt) or towards the rest of the portfolio (negative tilt).

apaWLS 1

  • apaWLSApplies a weight vector to a data matrix in order to perform weighted least squares (WLS) regression, i.e. multiplies each row by 1/sqrt of its weight.

Z

apaZScore 2

  • apaZScoreReturns the z-scores of a time series, i.e. the deviations from the mean in units of standard deviation.
  • apaZScore.OutlierReturns outlier flags based on z-scores: * for |z| >= 1, ** for |z| >= 2 and *** for |z| >= 3.