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
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).
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
apaAttribution.Consolidate.LevelConsolidates all portfolio segments up to a certain level.apaAttribution.Consolidate.SegmentConsolidates the portfolio constituents within a certain segment of a level.apaAttribution.Link.Frongello.AbsoluteCumulative chain-linking of absolute attributes (e.g. performance contributions) with the Frongello method.apaAttribution.Link.Frongello.RelativeCumulative chain-linking of relative attributes (e.g. performance attribution effects) with the Frongello method.
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
apaBlackLitterman.ImpliedConfidenceReturns the implied confidence in the views, given the views and an allocation.apaBlackLitterman.ImpliedWeightsReturns the implied asset weights (given expected returns) from an unrestricted mean-variance optimization problem, i.e. (RiskAversion * Covariances)^-1 * Returns.apaBlackLitterman.ImpliedReturnsReturns the implied equilibrium returns from an unrestricted mean-variance optimization problem, i.e. RiskAversion * Covariances * Weights.apaBlackLitterman.PosteriorReturns.Tau.FullConfReturns the vector of Black-Litterman posterior returns for a given tau, assuming 100% confidence in all views.apaBlackLitterman.PosteriorReturns.TauReturns the vector of Black-Litterman posterior returns for a given tau (Idzorek, 2005).apaBlackLitterman.PosteriorReturns.ConfidenceReturns the vector of Black-Litterman posterior returns with user-specified confidence levels for each view.
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
apaCategories.FromIndicesReturns the category indices and the constituent indices, sorted by category.apaCategories.FromIndices.CategoriesReturns the category indices of the constituents, sorted by category.apaCategories.FromIndices.ConstituentsReturns the constituent indices, sorted by category.apaCategories.Constituents.ReverseOrderReverses an order of constituent indices.apaCategories.FromLabelsReturns the category indices and the constituent indices, sorted by category.apaCategories.FromLabels.CategoriesReturns the category indices of the constituents, sorted by category.apaCategories.FromLabels.ConstituentsReturns the constituent indices, sorted by category.apaCategories.FromRegimes.MeanDerives categories (regimes) from conditioning variables, depending on whether an observation is above or below the arithmetic mean.apaCategories.FromRegimes.QuantilesDerives categories (regimes) from conditioning variables, each regime being a quantile.apaCategories.FromRegimes.ThresholdDerives categories (regimes) from conditioning variables, depending on whether an observation is below or above a threshold value.apaCategories.FromRegimes.SigmasDerives categories (regimes) from conditioning variables, each regime being defined by the number of standard deviations (sigmas) away from the arithmetic mean of each series.apaCategories.GroupMembership.FromIndicesReturns the group membership matrix from category indices.apaCategories.GroupMembership.FromLabelsReturns the group membership matrix from category labels.apaCategories.GroupMembershipToIndicesConverts a group membership matrix into a category index vector.apaCategories.LabelsToIndicesTurns category labels into category indices.apaCategories.Structure.FromIndicesReturns the category structure, i.e. the number of constituents in each category and the sorted constituents.apaCategories.Structure.FromLabelsReturns the category structure, i.e. the number of constituents in each category and the sorted constituents.
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
apaCertaintyEquivalentReturnReturns the mean-variance certainty-equivalent excess return.
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
apaClassificationAccuracyReturns the overall classification accuracy from observed and predicted class labels.
apaClustering 25
apaClustering.CDCClustering by measuring local direction centrality (CDC), following Peng et al.apaClustering.DBSCANClustering with the DBSCAN algorithm.apaClustering.DBSCAN.EpsilonCalibrates Epsilon to the knee of the sorted distances of the data points to their (MinPoints - 1)‑th nearest neighbor.apaClustering.Evaluation.AgreementCompares two clusterings using the confusion matrix and the Hungarian algorithm.apaClustering.Evaluation.ARICalculates the adjusted Rand index (ARI), a metric for evaluating the similarity between two clusterings when the cluster labels do not necessarily correspond.apaClustering.Evaluation.CentroidsEvaluates the assignments of a clustering algorithm: cluster centroids.apaClustering.Evaluation.InternalMetricsEvaluates the assignments of a clustering algorithm: various internal metrics.apaClustering.Evaluation.SilhouetteValuesEvaluates the assignments of a clustering algorithm: silhouette values for all data points.apaClustering.Hierarchical.AverageLinkagePerforms a hierarchical cluster analysis based on the average-linkage (UPGMA) algorithm.apaClustering.Hierarchical.ClusterCompositionsDerives the composition of the clusters as calculated by a hierarchical clustering algorithm.apaClustering.Hierarchical.ClusterCompositions.MatrixDerives the composition of the clusters as calculated by a hierarchical clustering algorithm.apaClustering.Hierarchical.Clusters.kCluster assignments based on the result of a hierarchical clustering algorithm and an imposed number of clusters k.apaClustering.Hierarchical.Result.MatrixReformats the result of a hierarchical clustering algorithm as a 1/0 (TRUE/FALSE) matrix.apaClustering.Hierarchical.CompleteLinkagePerforms a hierarchical cluster analysis based on the complete-linkage algorithm.apaClustering.Hierarchical.CopheneticCorrelationCoefficientCalculates the cophenetic correlation coefficient, a measure to assess the quality of the results of hierarchical clustering algorithms.apaClustering.Hierarchical.CophenticMatrixCalculates the cophenetic matrix from the result of a hierarchical clustering algorithm.apaClustering.kMeansStatistical classification with the k-means algorithm.apaClustering.kMeans.BisectingStatistical classification with the bisecting k-means algorithm.apaClustering.Hierarchical.SingleLinkagePerforms a hierarchical cluster analysis based on the single-linkage algorithm.apaClustering.Hierarchical.SortCorrsOrDistsSorts a correlation or distance matrix according to the order generated by a clustering algorithm: rows and columns are arranged in the leaf order of the dendrogram, so that elements of the same…apaClustering.Hierarchical.WardLinkagePerforms a hierarchical cluster analysis based on Ward’s linkage method.apaClustering.Hierarchical.WaterfallAllocationDerives the “waterfall allocation” from the output of a hierarchical clustering algorithm.apaClustering.Spectral.BiPartitionBi-partitioning by the sign of the entries of the Fiedler vector, i.e. the eigenvector of the second smallest eigenvalue of a Laplacian matrix.apaClustering.Spectral.DBSCANDBSCAN clustering on the spectral embedding of a Laplacian matrix.apaClustering.Spectral.kMeansk-means clustering on the spectral embedding of a Laplacian matrix with k = nEigenvectors + 1 clusters.
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
apaCoLPMs.AsymmetricalCalculates the asymmetric co-lower partial moment (co-LPM) matrix.apaCoLPMs.Asymmetrical.SymmetrizedCalculates the symmetrized asymmetric co-lower partial moment (co-LPM) matrix.apaCoLPMs.SymmetricalCalculates the symmetric co-lower partial moment (co-LPM) matrix.
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
apaContribution.BetaCalculates the ex post contributions to portfolio beta, based on time-variable asset weights.apaContribution.CorrelsReturns the asset contributions to the correlation of an asset with the overall portfolio.apaContribution.CVaR.NormalCalculates the contributions to ex ante portfolio normal CVaR from portfolio constituent weights and returns.apaContribution.CVaR.NumericalCalculates numerical contributions to non-parametric (historical) conditional value at risk (CVaR).apaContribution.CVaR.ModifiedCalculates the contributions to parametric modified conditional value at risk (modified CVaR).apaContribution.CDaR.NumericalCalculates numerical contributions to non-parametric conditional drawdown at risk (CDaR).apaContribution.DaR.NumericalCalculates numerical contributions to non-parametric drawdown at risk (DaR).apaContribution.KurtosisCalculates the contributions of portfolio constituents to portfolio kurtosis (population moments).apaContribution.ReturnReturns the marginal contributions, constituent contributions and percentage constituent contributions to portfolio return.apaContribution.SharpeRatioReturns the marginal contributions, component contributions and component percentage contributions to the portfolio Sharpe ratio, calculated from constituent weights, expected returns and…apaContribution.SharpeRatio.IncrementalReturns the incremental contributions to the portfolio Sharpe ratio.apaContribution.SkewnessCalculates the contributions of portfolio constituents to portfolio skewness.apaContribution.TrackingErrorReturns the marginal tracking errors, the contributions to tracking error and the percentage contributions to tracking error, given portfolio and benchmark weights and the constituent returns of…apaContribution.TrackingError.VariableWeightsCalculates the contributions to ex post portfolio tracking error, taking into account time-variable portfolio weights.apaContribution.VaR.NormalCalculates the contributions to ex ante portfolio normal VaR from portfolio constituent weights and returns.apaContribution.VaR.NumericalCalculates numerical contributions to non-parametric (historical) value at risk (VaR).apaContribution.VaR.ModifiedCalculates the contributions to parametric modified value at risk (modified VaR).apaContribution.VolatilityCalculates the contributions of portfolio constituents to ex ante portfolio volatility, calculated from constituent covariances.apaContribution.Volatility.ExpWeightedCalculates the contributions of portfolio constituents to ex ante exponentially weighted portfolio volatility.apaContribution.Volatility.IncrementalReturns the incremental contributions to portfolio volatility.apaContribution.Volatility.VariableWeightsCalculates the contributions to ex post portfolio volatility, taking into account time-variable constituent weights.
apaCopula 19
apaCopula.Empirical.CdfCumulative distribution function (cdf) of the bivariate empirical copula.apaCopula.Empirical.PdfProbability density function (pdf) of the bivariate empirical copula.apaCopula.Empirical.Pdf.MultivariateMultivariate empirical copula density function: all pairwise copula densities.apaCopula.Empirical.Pdf.Multivariate.BiMultivariate empirical copula density function of a particular pair of data series.apaCopula.Empirical.Pdf.Multivariate.UniMultivariate empirical copula density functions of all pairs involving a particular data series.apaCopula.Empirical.Pdf.Multivariate.PairsMultivariate empirical copula density functions of all neighboring pairs (e.g. A-B, B-C, C-D and so on).apaCopula.Empirical.ResampleResamples observations from an empirical copula.apaCopula.Empirical.Resample.ShrinkResamples observations from an empirical copula and applies shrinkage towards a parametric copula.apaCopula.Independent.SimSimulates uniform marginals from the independence copula: an nObs x nDims matrix of independent uniform random numbers.apaCopula.SymJoeClayton.EstimateEstimates the upper and lower tail dependence of the symmetrized Joe-Clayton copula from a sample: a 2 x 1 vector (TauUpper; TauLower) for all k columns jointly, or a k x k matrix of bivariate…apaCopula.SymJoeClayton.CdfCumulative distribution function of the symmetrized Joe-Clayton copula.apaCopula.SymJoeClayton.PdfProbability density function of the symmetrized Joe-Clayton copula.apaCopula.SymJoeClayton.SimSimulates uniform marginals from the symmetrized Joe-Clayton copula: an n x nDims matrix with the same upper and lower tail dependence for all pairs of columns.apaCopula.Clayton.EstimateEstimates the parameter α of the Clayton copula (lower tail dependence) from a sample: a single value for all k columns jointly, or a k x k matrix of bivariate estimates.apaCopula.Clayton.SimSimulates uniform marginals from the Clayton copula, i.e. data with lower tail dependence: an nObs x nDims matrix with the same Alpha for all pairs of columns.apaCopula.Gaussian.SimSimulates uniformly distributed variables from the Gaussian copula: nObs x 2 for a single correlation, nObs x k for a k x k correlation matrix.apaCopula.t.Estimate.CorrelsEstimates the correlation matrix of the Student t copula from a sample: jointly from all k columns, or pair by pair.apaCopula.t.Estimate.DoFEstimates the degrees of freedom ν of the Student t copula from a sample: a single value for all k columns jointly, or a k x k matrix of bivariate estimates.apaCopula.t.SimSimulates uniformly distributed variables from the Student t copula: nObs x 2 for a single correlation, nObs x k for a k x k correlation matrix.
apaCorrel 17
apaCorrel.ConfidenceIntervalsCalculates a two-sided confidence interval for the Pearson correlation coefficient of two series by resampling.apaCorrel.Conditional.Box.In.DataReturns the observations where X is inside a box defined by a lower and an upper quantile.apaCorrel.Conditional.Box.In.Joint.DataReturns the observations where both X and Y are inside a box defined by a lower and an upper quantile.apaCorrel.Conditional.Box.Out.DataReturns the observations where X is outside a box defined by a lower and an upper quantile.apaCorrel.Conditional.Box.Out.Joint.DataReturns the observations where at least one of X and Y is outside a box defined by a lower and an upper quantile.apaCorrel.Conditional.Quantile.Lower.DataReturns the observations where X is at or below the quantile.apaCorrel.Conditional.Quantile.Joint.Lower.DataReturns the observations where both X and Y are at or below the quantile.apaCorrel.Conditional.Quantile.Upper.DataReturns the observations where X is above the quantile.apaCorrel.Conditional.Quantile.Joint.Upper.DataReturns the observations where both X and Y are above the quantile.apaCorrel.ExceedanceCalculates the exceedance correlation of two series, i.e. the correlation of the observations where both series are below (Quantile <= 0.5) or above (Quantile > 0.5) the quantile.apaCorrel.ExpWeightedReturns the exponentially weighted correlation coefficient between two time series.apaCorrel.GerberCalculates the Gerber statistic, a robust co-movement measure between two time series.apaCorrel.Gerber.AlteredCalculates the altered Gerber statistic between two time series.apaCorrel.Gerber.ModifiedCalculates the modified Gerber statistic between two time series.apaCorrel.ImpliedCalculates the average (constant) correlation implied by a portfolio volatility, constituent weights and constituent volatilities.apaCorrel.KendallCalculates Kendall’s tau-b for two data vectors X and Y .apaCorrel.SpearmanCalculates Spearman’s rank correlation coefficient.
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
apaCoUPMs.AsymmetricalCalculates the asymmetric co-upper partial moment (co-UPM) matrix.apaCoUPMs.Asymmetrical.SymmetrizedCalculates the symmetrized asymmetric co-upper partial moment (co-UPM) matrix.apaCoUPMs.SymmetricalCalculates the symmetric co-upper partial moment (co-UPM) matrix.
apaCovar 2
apaCovar.DownsideCalculates the downside semi-covariance of two return series.apaCovar.ExpWeightedReturns the exponentially weighted covariance between two time series.
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
apaDaR.EmpiricalCalculates the empirical drawdown at risk (DaR) from a time series matrix of returns.apaDaR.Empirical.ConfidenceIntervalsCalculates resampled confidence intervals for the empirical drawdown at risk (DaR).
apaData 27
apaData.DatatypesReturns the data type of each cell of a data matrix:apaData.Dates.Earliest.MonthReturns the first observation (complete row) of each calendar month.apaData.Dates.Earliest.QuarterReturns the first observation (complete row) of each calendar quarter.apaData.Dates.Earliest.WeekReturns the first observation (complete row) of each week (Monday to Sunday).apaData.Dates.Earliest.YearReturns the first observation (complete row) of each calendar year.apaData.Dates.Latest.MonthReturns the last observation (complete row) of each calendar month.apaData.Dates.Latest.QuarterReturns the last observation (complete row) of each calendar quarter.apaData.Dates.Latest.WeekReturns the last observation (complete row) of each week (Monday to Sunday).apaData.Dates.Latest.YearReturns the last observation (complete row) of each calendar year.apaData.Dates.Match.AJoins two data matrices on the Excel dates in their first columns and keeps all dates of the first matrix.apaData.Dates.Match.BJoins two data matrices on the Excel dates in their first columns and keeps all dates of the second matrix.apaData.Dates.Match.AandBJoins two data matrices on the Excel dates in their first columns and keeps only the dates found in both matrices.apaData.Dates.Match.AorBJoins two data matrices on the Excel dates in their first columns and keeps the dates found in either matrix.apaData.Digits.AfterReturns the number of decimal places of each number in a data matrix.apaData.Digits.BeforeReturns the number of digits before the decimal point of each number in a data matrix.apaData.Drop.Zeros.RowsDrops all rows (joint observations) that contain a numeric zero.apaData.GapsCalculates the size and frequency of gaps in data.apaData.Gaps.MatrixReplaces each non-numeric cell by the length of the gap it belongs to and each numeric cell by 0.apaData.nObs.BivariateReturns a matrix with the number of observations available for correlation calculations from jagged data: univariate numbers of observations on the main diagonal, bivariate joint observations on…apaData.nObs.JointReturns the number of joint observations in a jagged data matrix.apaData.nObs.Joint.DropSeriesReturns the number of joint observations when each series is dropped individually.apaData.nObs.Joint.DropObsReturns the number of joint observations if each observation is dropped individually.apaData.nObs.nTypes.ObservationsCounts the non-zero numbers, zeros, positive numbers, negative numbers, blanks, text, error values and logical values for each observation (row).apaData.nObs.nTypes.SeriesCounts the non-zero numbers, zeros, positive numbers, negative numbers, blanks, text, error values and logical values for each series (column).apaData.Proxy.CategoryAverageProxies series with category average values.apaData.RepeatsCalculates the size and frequency of repeats in data.apaData.Repeats.MatrixReplaces each cell that belongs to a repeat by the length of that repeat and all other cells by 0.
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
apaDecisionTree.Regression.FittedDecision tree regression: returns the fitted values of Y.apaDecisionTree.Regression.PredictDecision tree regression: returns the predicted values of Y for new values of X.apaDecisionTree.Regression.ResidualsDecision tree regression: returns the residuals.apaDecisionTree.Regression.ScatterPlotDecision tree regression: returns a representation of the tree structure for plotting.apaDecisionTree.Regression.StructureDecision tree regression: returns a flat representation of the tree structure.apaDecisionTree.Regression.R2Decision tree regression: returns the R-squared.apaDecisionTree.Regression.Timeseries.ForecastDecision tree regression for time series forecasts: returns n-step-ahead forecasts with forecast intervals.apaDecisionTree.Regression.Timeseries.R2Decision tree regression for time series forecasts: returns the R-squared.apaDecisionTree.Regression.PredictorsAndTheirSplitsDecision tree regression: returns the selected predictor variables and their split points.
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
apaDetrend.LinearRegressDetrends data with a linear regression in time, y = a + b*t.apaDetrend.LinearRegress.TrendDetrends data with a linear regression in time, y = a + b*t.apaDetrend.LinearRegress.Trend.AheadDetrends data with a linear regression in time, y = a + b*t.apaDetrend.PolynomialDetrends data with a polynomial expression in t of order n.apaDetrend.Polynomial.TrendDetrends data with a polynomial expression in t of order n.apaDetrend.Polynomial.Trend.AheadDetrends data with a polynomial expression in t of order n.
apaDistances 20
apaDistances.AngularDerives the angular distance matrix from a data matrix.apaDistances.AverageCalculates the average distance between all objects.apaDistances.AveragesCalculates the average distance of each object from all other objects.apaDistances.ChebyshevDerives the Chebyshev distance matrix from a data matrix.apaDistances.CorrelDerives a correlation-based distance matrix from a data matrix.apaDistances.Correl.FromCorrelsDerives a distance matrix from a correlation matrix.apaDistances.Correl.LinearDerives a distance matrix from a data matrix.apaDistances.Correl.Linear.FromCorrelsDerives a distance matrix from a correlation matrix.apaDistances.Correl.TrigonometricDerives a distance matrix from a data matrix.apaDistances.Correl.Trigonometric.FromCorrelsDerives a distance matrix from a correlation matrix.apaDistances.CosineDerives the cosine distance matrix from a data matrix.apaDistances.CovarDerives a distance matrix from the covariance structure of a data matrix.apaDistances.Covar.FromCovarsDerives a distance matrix from a covariance matrix.apaDistances.EuclidianDerives the Euclidean distance matrix from a data matrix.apaDistances.FromSimilaritiesDerives a distance matrix from a similarity matrix.apaDistances.MahalanobisReturns the Mahalanobis distance of each observation of a data matrix X from the mean of a data matrix Y.apaDistances.Mahalanobis.CriticalValueReturns the critical value of the Mahalanobis distance at a given confidence level.apaDistances.ManhattanDerives the Manhattan distance matrix from a data matrix.apaDistances.MinkowskiDerives the Minkowski distance matrix of order p from a data matrix, a generalized distance measure.apaDistances.WeightedOrUnweightedReturns the distance matrix unchanged (weighted) or as an unweighted matrix with unit distances, i.e. 1 for each non-zero entry and 0 otherwise.
apaDiversificationChart 5
apaDiversificationChart.CVarCalculates the average CVaR of all possible equal-weighted portfolios.apaDiversificationChart.KurtCalculates the average, minimum and maximum sample excess kurtosis (as the Excel function KURT) of all possible equal-weighted portfolios, and the number of portfolios.apaDiversificationChart.SkewCalculates the average skewness of all possible equal-weighted portfolios.apaDiversificationChart.DaRCalculates the average drawdown at risk (DaR) of all possible equal-weighted portfolios.apaDiversificationChart.VolatilityCalculates the average volatility of all possible equal-weighted portfolios.
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
apaDrawdowns.DrawdownReturns the vector of drawdowns of a time series, i.e. the losses from the previous local high-water mark before the local maximum loss has occurred.apaDrawdowns.Drawdown.MaxReturns the maximum drawdown including its start, bottom and end date.apaDrawdowns.Drawdown.Max.AllReturns the maximum drawdowns in all underwater periods.apaDrawdowns.Drawdown.WithZerosReturns the drawdowns of a time series, i.e. the losses from the previous local high-water mark before the local maximum loss has occurred, with zeros for all other observations.apaDrawdowns.Drawdown.Max.ExpectedReturns the expected maximum drawdown of a geometric Brownian motion over a certain time period.apaDrawdowns.HighwatermarkReturns the trajectory of the high-water mark.apaDrawdowns.Recovery.WithZerosReturns the recovery returns, i.e. the gains from the local maximum loss back to the previous high-water mark, with zeros for all other observations.apaDrawdowns.UnderwaterReturns the underwater returns, i.e. the losses from the previous local high-water mark.apaDrawdowns.Underwater.PathsReturns all filtered historical underwater paths of a time series.apaDrawdowns.Underwater.StartReturns an indicator vector with the start points of drawdowns of a certain size (1 if an underwater period starts, 0 otherwise).apaDrawdowns.Underwater.WithZerosReturns the underwater returns, i.e. the losses from the previous local high-water mark, with zeros for the observations above water.
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
apaElasticGradientDescentRegressionElastic gradient descent regression, which combines ridge regression and forward stagewise regression.
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
apaEntropy.ShannonCalculates the Shannon entropy of a probability vector.
apaEVT 1
apaEVT.TailIndex.HillMethodEstimates the tail index with the least-squares Hill method, i.e. a regression on the m largest losses.
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
apaFirstPassageTime.Resampled.CdfGenerates the cumulative distribution function (cdf) of first passage times by resampling empirical returns.apaFirstPassageTime.Resampled.PdfGenerates the probability density function (pdf) of first passage times by resampling empirical returns.
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
apaGARCH11.Volatility.EstimateEstimates the GARCH(1,1) parameters alpha and beta by maximum likelihood, with variance targeting.apaGARCH11.Volatility.ConditionalCalculates the current conditional (short-term) volatility implied by the GARCH(1,1) parameters.apaGARCH11.Volatility.Conditional.ForwardCalculates the GARCH(1,1) forward volatility nPeriods ahead.apaGARCH11.Volatility.Conditional.ExpectedForwardCalculates the expected average GARCH(1,1) volatility over the next nPeriods, e.g. for the term structure of volatility.apaGARCH11.Volatility.ChartCalculates a three-column matrix with 1) the squared innovations, 2) the unconditional volatility and 3) the conditional GARCH(1,1) volatility for each observation.apaGARCH11.Volatility.SimulateSimulates a GARCH(1,1) process with zero mean and returns an n x 1 vector of simulated returns.
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
apaGraph.AdjacencyMatrix.FromEdgesDerives the adjacency matrix of a graph from an edge list.apaGraph.AdjacencyMatrix.FromIncidenceMatrixDerives the adjacency matrix of a graph from an incidence matrix.apaGraph.AdjacencyMatrix.ToSimilaritiesConverts an adjacency matrix into a similarity matrix.apaGraph.BetweennessCentrality.FromEdgesCalculates the betweenness centrality of the nodes of an undirected graph, weighted or unweighted, with Brandes’ algorithm.apaGraph.Centralization.Freeman.FromEdgesCalculates Freeman’s centralization measure of a graph defined by an edge list.apaGraph.ClosenessCentrality.FromEdgesCalculates the closeness centrality of all nodes (vertices) of a graph defined by an edge list.apaGraph.Communities.CommunityAdjacencyMatrixReturns the community adjacency matrix induced by a node-level graph and a community assignment.apaGraph.Communities.CommunityAggregationMatrixReturns the binary community aggregation matrix P, with communities in rows and nodes in columns.apaGraph.Communities.GirvanNewman.ModularityPathReturns the Girvan-Newman modularity path of a graph or MST.apaGraph.Communities.GirvanNewmanIdentifies Girvan-Newman communities.apaGraph.Communities.GirvanNewman.NIdentifies Girvan-Newman communities for a fixed number of communities N.apaGraph.Communities.CommunityGraphReturns the community graph induced by a node-level graph and a community assignment.apaGraph.Communities.GreedyAgglomerativeReturns greedy agglomerative modularity communities.apaGraph.Communities.GreedyAgglomerative.NReturns greedy agglomerative modularity communities for a fixed number of communities N.apaGraph.Communities.GreedyAgglomerative.ModularityPathReturns the greedy agglomerative modularity path.apaGraph.Communities.CommunityLaplacianReturns the community Laplacian matrix L = D - A induced by a node-level graph and a community assignment, where A is the community adjacency matrix and D the diagonal matrix of community degrees.apaGraph.Communities.CommunityLaplacian.LiftedReturns the lifted community Laplacian matrix P' * Lc * P in node (asset) space, where Lc is the community Laplacian and P the community aggregation matrix.apaGraph.DegreeCentrality.FromEdgesCalculates the degree centrality of all nodes (vertices) of a graph defined by an edge list.apaGraph.DegreeMatrixDerives the degree matrix from a distance (or similarity) matrix.apaGraph.EccentricityCalculates the eccentricity of each node of a graph, i.e. the largest shortest distance of the node to any other node.apaGraph.Edges.FromAdjacencyMatrixDerives the edge list of a graph from an adjacency matrix.apaGraph.Edges.FromClusteringResultConverts the result of a hierarchical clustering algorithm into an edge list.apaGraph.Edges.FromDistanceMatrixDerives the edge list of a complete graph from a distance matrix.apaGraph.Edges.FromIncidenceMatrixDerives the edge list of a graph from an incidence matrix.apaGraph.Edges.RandomGenerates a random graph and returns it as an m x 3 edge list: node i, node j (1-based, i < j, sorted by i and then j) and the distance between the two nodes.apaGraph.EdgeThinning.BuildReturns an edge list derived from the following thinning algorithm: start with all edges, sort them by distance (largest first), and delete an edge unless the deletion disconnects the graph. 100%…apaGraph.EigenvectorCentrality.FromEdgesCalculates the eigenvector centrality (Bonacich power centrality) of all nodes (vertices) of a graph defined by an edge list.apaGraph.Fiedler.ValueReturns the Fiedler value, i.e. the second smallest eigenvalue of the Laplacian matrix (algebraic connectivity).apaGraph.Fiedler.VectorReturns the Fiedler vector, i.e. the eigenvector belonging to the second smallest eigenvalue of the Laplacian matrix.apaGraph.IncidenceMatrix.FromAdjacencyMatrixDerives the incidence matrix of a graph from an adjacency matrix.apaGraph.IncidenceMatrix.FromEdgesDerives the incidence matrix of a graph from an edge list.apaGraph.IsCompleteChecks whether a graph is connected, i.e. whether every node can be reached from every other node.apaGraph.kNN.BuildReturns the edge list of the k-nearest-neighbor (kNN) graph at the smallest k at which the graph is connected, or that k.apaGraph.kNN.Build.KReturns the edge list of the k-nearest-neighbor (kNN) graph for a given k.apaGraph.LaplacianMatrixReturns the Laplacian matrix of a graph, also known as Kirchhoff matrix, from an adjacency matrix.apaGraph.LaplacianMatrix.RWReturns the random walk (or left) normalized Laplacian matrix of a graph from an adjacency matrix.apaGraph.LaplacianMatrix.SymReturns the symmetric normalized Laplacian matrix of a graph from an adjacency matrix.apaGraph.Layout.CircularCircular layout of a graph defined by an edge list.apaGraph.Layout.ForceAtlas2ForceAtlas2 layout of an edge list.apaGraph.Layout.ForceAtlas2.AllParamsForceAtlas2 layout of an edge list with an extended parameter set.apaGraph.Layout.ForceDirectedForce-directed layout of a graph defined by an edge list.apaGraph.Layout.ForceDirected.AllParamsForce-directed layout of an edge list with all parameters exposed.apaGraph.Layout.KamadaKawaiKamada-Kawai layout of a graph defined by an edge list.apaGraph.Layout.KamadaKawai.AllParamsKamada-Kawai layout of an edge list with all parameters exposed.apaGraph.Layout.SpectralSpectral layout of a graph defined by an edge list.apaGraph.Layout.TutteEmbeddingLayout of a planar graph defined by an edge list, based on the Tutte embedding algorithm (unweighted only).apaGraph.Layout.YifanHuYifan Hu layout of an edge list.apaGraph.Layout.YifanHu.AllParamsYifan Hu multilevel layout of an edge list with an extended parameter set.apaGraph.MinimumSpanningTreeReturns the minimum spanning tree (MST) of a distance matrix as an edge list, using Kruskal’s algorithm.apaGraph.MinimumSpanningTree.FromEdgesReturns the minimum spanning tree (MST) of a graph given as an edge list, using Kruskal’s algorithm.apaGraph.NeighboursFromEdgesReturns the neighbours of each node of a graph defined by an edge list.apaGraph.Nodes.CentralReturns the indices of the central nodes, i.e. the nodes with an eccentricity equal to the radius of the graph (smallest eccentricity).apaGraph.Nodes.LeavesReturns the indices of the leaf nodes, i.e. the nodes connected by one edge only.apaGraph.Nodes.PeripheralReturns the indices of the peripheral nodes, i.e. the nodes with an eccentricity equal to the diameter of the graph (largest eccentricity).apaGraph.ShortestDistances.AllCalculates the shortest distances between all pairs of nodes (vertices) of a graph with Dijkstra’s algorithm.apaGraph.ShortestDistances.FromCalculates the shortest distances from a given node (vertex) to all other nodes of a graph with Dijkstra’s algorithm.apaGraph.Text.KeyphrasesBuilds a word co-occurrence graph from raw text and returns the top N keyphrases, ranked by graph-based word scores.apaGraph.Text.KeysentenceReturns ranked key sentences from a sentence-similarity graph using PageRank-style scoring.apaGraph.Text.KeywordsBuilds a word co-occurrence graph from raw text and returns the top N keywords, ranked by the selected graph centrality method.apaGraph.Text.SentenceEdgeListReturns the weighted sentence-distance edge list extracted from raw text.apaGraph.Text.SentenceListReturns the indexed sentence list extracted from raw text, i.e. the nodes of the sentence graph.apaGraph.Text.WordEdgeListBuilds a word co-occurrence graph from raw text and returns a three-column edge list: source index, target index and weight.apaGraph.Text.WordListBuilds the node list from raw text and returns a two-column matrix: node index and node text.apaGraph.Topology.AverageShortestPathCalculates the average shortest path length of a graph, weighted or unweighted.apaGraph.Topology.DiameterCalculates the diameter of a graph, i.e. the largest shortest distance between any two nodes.apaGraph.Topology.LeafFractionCalculates the leaf fraction of a graph, i.e. the percentage of nodes with one connection only.apaGraph.Topology.MeanOccupationLayerCalculates the mean occupation layer of a graph relative to its central node, the node with the most connections.apaGraph.Topology.OverlapCounts the number of connections n which occur in both of two graphs with n1 and n2 connections. 2 * n / (n1 + n2) gives the percentage overlap.apaGraph.Topology.RadiusCalculates the radius of a graph, i.e. the smallest eccentricity of all nodes.apaGraph.Topology.TotalWeightCalculates the total weight of a graph, i.e. the sum of all edge weights.apaGraph.TriangulatedMaximallyFilteredFinds the triangulated maximally filtered graph (TMFG) of a distance matrix and returns it as an edge list.
H
apaHalflifeToLambda 1
apaHalflifeToLambdaConverts a half-life into the corresponding exponential decay factor lambda.
apaHenrikssonMerton 2
apaHenrikssonMerton.AlphaReturns the Henriksson-Merton alpha, i.e. the selectivity intercept of the market-timing regression.apaHenrikssonMerton.GammaReturns the Henriksson-Merton market-timing coefficient γ.
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
apaIchimoku.ChartCalculates the inputs needed for an Ichimoku Kinko Hyo chart.
apaImputation 14
apaImputation.Delete(Listwise) deletion: handles missing observations by excluding incomplete data records.apaImputation.Interpolate.LinearHandles missing observations by linear interpolation between the last and the next existing observations.apaImputation.Interpolate.SplineHandles missing observations by natural spline interpolation between the last and the next existing observations.apaImputation.LastHandles missing observations by replacing them with the last available observation.apaImputation.Mean.CrosssectionHandles missing observations by replacing them with the cross-sectional mean of all series with observations.apaImputation.Mean.Crosssection.CategoryHandles missing observations by replacing them with the cross-sectional mean of the series in the same category with observations.apaImputation.Mean.TimeseriesHandles missing observations by replacing them with the unconditional mean of the respective series.apaImputation.NextHandles missing observations by replacing them with the next available observation.apaImputation.Regress.LinearImputes missing observations from a linear regression of the incomplete series on the other series.apaImputation.ResampleHandles missing observations by resampling the missing joint observations from the existing ones.apaImputation.Resample.MVNImputes missing observations with samples from a conditional multivariate normal distribution.apaImputation.Resample.MVN.FromUncondParamsImputes missing observations with samples from a conditional multivariate normal distribution with imposed means and covariances (which are not necessarily the means and covariances of the…apaImputation.Resample.MVTImputes missing observations with samples from a conditional multivariate (Student) t distribution.apaImputation.Resample.MVT.FromUncondParamsImputes missing observations with samples from a conditional multivariate (Student) t distribution with imposed means and covariances.
apaInformationRatio 2
apaInformationRatio.ActiveReturnsCalculates the information ratio based on active returns, i.e. the average active return divided by the tracking error.apaInformationRatio.ResidualReturnsCalculates the information ratio based on the residual returns of the single-index model, i.e. alpha divided by residual risk.
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
apaIsStructuralBreakChowPerforms a Chow test for a structural break in a linear regression at a given breakpoint.
apaIsUnitRootADF 1
apaIsUnitRootADFAugmented Dickey-Fuller test for a unit root.
apaIsValidAllocation 3
apaIsValidAllocation.Group.BoundsValidates whether allocations conform to the lower and upper bounds on group exposures.apaIsValidAllocation.UCITS.51040Checks whether allocations conform to the UCITS 5/10/40 rule, i.e. that no single position is larger than 10% and that all positions larger than 5% do not add up to more than 40%.apaIsValidAllocation.TE.UpperBoundValidates whether allocations conform to a given upper tracking error limit.
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
apakNearestNeighbour.AdjacencyMatrixTurns the k nearest neighbors of each data point into an adjacency matrix.apakNearestNeighbour.ClassifierClassifies unknown data with the k-nearest neighbors (kNN) algorithm: each unknown data point receives the category label held by the majority of its k nearest known data points (Euclidean distance).apakNearestNeighbour.Distances.AllReturns the distances of each data point to its nearest neighbors as a (c - 1) x c matrix; row k contains the distance of each data point to its k-th nearest neighbor.apakNearestNeighbour.Distances.AveragesReturns the average distance of each data point to its k nearest neighbors as a 1 x c vector.apakNearestNeighbour.Distances.kReturns the distance of each data point to its k-th nearest neighbor (k-th kNN distance).apakNearestNeighbour.Distances.k.SortedReturns the distances of the data points to their k-th nearest neighbor, sorted in ascending order.apakNearestNeighbour.LocalOutlierFactorCalculates the local outlier factor (LOF) of each data point, based on its k nearest neighbors (Breunig et al., 2000).apakNearestNeighbour.Points.CoreClassifies the data points as in the DBSCAN algorithm.apakNearestNeighbour.Points.NeighbourReturns the nearest neighbors of each data point as a (c - 1) x c matrix of column indices; row k contains the index of the k-th nearest neighbor.apakNearestNeighbour.Regressionk-nearest neighbors (kNN) regression: for each data point, an OLS regression with a constant is fitted to the data point and its k nearest neighbors, and the fitted value at the data point is…apakNearestNeighbour.Smootherk-nearest neighbors (kNN) smoother: replaces each data point by the average of itself and its k nearest neighbors, feature by feature.
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
apaLicense.CodeReturns the license code assigned to the computer currently being used.apaLicense.ExpiryDateReturns the expiry date of the subscription period of the current license code.apaLicense.Computers.InUseReturns the number of computers assigned to the current license code.apaLicense.Computers.PurchasedReturns the number of computers purchased, i.e. the maximum number of computers which can be assigned to the current license code.apaLicense.Computer.NameReturns the name of the computer currently being used.apaLicense.Computer.Name.AllReturns the names of all computers assigned to the current license code.apaLicense.Computer.DeactivateDeactivates the current computer such that the add-in can be activated and used on another computer.apaLicense.Computer.Deactivate.NameDeactivates a computer, identified by its name, from the current license.
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
apaLogisticFunctionCalculates the standard logistic function 1/(1+exp(-X)).apaLogisticFunction.FirstAntiderivativeCalculates the first antiderivative of the standard logistic function, ln(1+exp(X)).apaLogisticFunction.FirstDerivativeCalculates the first derivative of the standard logistic function, exp(X)/((1+exp(X))^2).apaLogisticFunction.GeneralizedCalculates the generalized logistic function LeftHorAsympt + (RightHorAsympt - LeftHorAsympt) / (1 + exp(-X(i,j)*Curvature)).apaLogisticFunction.InverseCalculates the inverse of the standard logistic function, -ln((1/Y)-1).
apaLognormalToNormal 4
apaLognormalToNormal.MeanConverts the mean and volatility of a lognormal variable into the mean of the underlying normal variable.apaLognormalToNormal.VolatilityConverts the mean and volatility of a lognormal variable into the volatility of the underlying normal variable.apaLognormalToNormal.CovarianceConverts the covariance of two lognormal variables into the covariance of the underlying normal variables.apaLognormalToNormal.CorrelationConverts the correlation of two lognormal variables into the correlation of the underlying normal variables.
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
apaManual.UpdateDownloads the latest version of the PDF manual.
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
apaMarkov.Hidden.MVC.EstimateEstimates a hidden Markov model with multivariate categorical emissions and returns the emission probabilities, the transition matrix and the state probabilities.apaMarkov.Hidden.MVC.StateProbabilitiesReturns the smoothed posterior (or filtered) state probabilities of a multivariate categorical hidden Markov model.apaMarkov.Hidden.MVN.EstimateEstimates a hidden Markov model with multivariate normal emissions and returns the parameters and the state probabilities.apaMarkov.Hidden.MVN.LogLikelihoodSamplesReturns the per-sample log-likelihoods under an estimated multivariate normal hidden Markov model.apaMarkov.Hidden.MVN.nObsRecommendedReturns the minimum number of observations recommended for estimating a multivariate normal hidden Markov model.apaMarkov.Hidden.MVN.SimulateSimulates Gaussian emissions from a Markov regime switching process, i.e. multivariate normally distributed returns whose means, volatilities and correlations depend on a hidden state following a…apaMarkov.Hidden.MVN.StateProbabilitiesReturns the smoothed posterior (or filtered) state probabilities of a multivariate normal hidden Markov model.apaMarkov.Hidden.MVT.EstimateEstimates a hidden Markov model with multivariate Student t emissions and state-specific degrees of freedom, and returns the parameters and the state probabilities.apaMarkov.Hidden.MVT.StateProbabilitiesReturns the smoothed posterior (or filtered) state probabilities of a multivariate Student t hidden Markov model.apaMarkov.Hidden.MVT.LogLikelihoodSamplesReturns the per-sample log-likelihoods under an estimated multivariate Student t hidden Markov model with state-specific degrees of freedom.apaMarkov.HigherOrder.StatePath.FromStatePathDerives the higher-order state path from a state path and an order.apaMarkov.HigherOrder.StatePath.Labels.FromStatePathDerives the higher-order state path from a state path and an order, returning formatted state labels.apaMarkov.IsIrreducibleChecks whether a Markov chain is irreducible.apaMarkov.IsAperiodicChecks whether a Markov chain is aperiodic.apaMarkov.IsErgodicChecks whether a Markov chain is ergodic.apaMarkov.PathProbability.ConditionalCalculates the probability of an observed state path, given a transition probability matrix and conditional on the first state.apaMarkov.PathProbability.UnconditionalCalculates the unconditional probability of an observed state path.apaMarkov.SemiHidden.Gaussian.EstimateEstimates a Gaussian hidden semi-Markov model (HSMM) with explicit state duration distributions and returns the parameters, the duration statistics and the state probabilities.apaMarkov.SecondOrder.TestTests a first-order state path for the presence of second-order Markov dependence.apaMarkov.SimulateSimulates a state path from a Markov chain defined by a transition probability matrix.apaMarkov.StateDuration.AnalysisCompares the empirical state durations with the geometric duration distribution implied by an estimated Markov chain.apaMarkov.StateDurations.ExpectedCalculates the expected state durations implied by a transition probability matrix.apaMarkov.StatePath.FromConditionsReturns the Markov state path from conditioning variables and threshold values.apaMarkov.StatePath.LabelsAndLocalStatesReturns the Markov state path labels derived from conditioning variables and threshold values, plus all local states.apaMarkov.StationaryDistributionCalculates the stationary (steady state) distribution implied by a transition probability matrix.apaMarkov.StationaryDistribution.ConfidenceIntervalsCalculates confidence intervals for the stationary (steady state) distribution by resampling from an observed state path.apaMarkov.TransitionProbabilityMatrix.FromStatePathDerives the transition probability matrix from an observed trajectory of states.
apaMatrix 112
apaMatrix.AdjugateReturns the adjugate matrix of a matrix.apaMatrix.Averages.CategoriesReturns the equally-weighted arithmetic category means of a data matrix.apaMatrix.Averages.Categories.WeightedReturns the weighted arithmetic category means of a data matrix.apaMatrix.Averages.ColsReturns the column averages of a matrix.apaMatrix.Averages.Diagonal.MajorReturns the averages of all major diagonals of a matrix.apaMatrix.Averages.Diagonal.MinorReturns the averages of all minor diagonals of a matrix.apaMatrix.Averages.RowsReturns the row averages of a matrix.apaMatrix.Center.ColsCenters the columns of a matrix such that their means are zero.apaMatrix.Center.DoubleCenters the rows and columns of a matrix such that both their means are zero.apaMatrix.Center.RowsCenters the rows of a matrix such that their means are zero.apaMatrix.CenteringCreates the n x n centering matrix H = I − (1/n)*1*1', with n = Size.apaMatrix.ChangeSign.OffDiagonal.MajorChanges the sign of the entries off the main diagonal of a matrix.apaMatrix.ChangeSign.Diagonal.MajorChanges the sign of the entries on the main diagonal of a matrix.apaMatrix.CholeskyReturns the Cholesky decomposition of a symmetric positive definite matrix.apaMatrix.CofactorsReturns the matrix of all cofactors of a matrix.apaMatrix.Concatenate.ColsStacks two matrices in the horizontal direction.apaMatrix.Concatenate.RowsStacks two matrices in the vertical direction.apaMatrix.ConditionNumberReturns the condition number of a matrix.apaMatrix.Cumsum.ColsReturns the running cumulative sums by columns.apaMatrix.Cumsum.RowsReturns the running cumulative sums by rows.apaMatrix.Diagonal.Minor.GetReturns a vector containing the elements on the minor diagonal of a matrix.apaMatrix.Diagonal.Minor.Nth.GetReturns a vector containing the elements on the n-th minor diagonal of a matrix.apaMatrix.Diagonal.Minor.PutReturns a square matrix of zeros with the elements of a vector on the minor diagonal.apaMatrix.Diagonal.Major.GetReturns a vector containing the elements on the major diagonal of a matrix.apaMatrix.Diagonal.Major.Nth.GetReturns a vector containing the elements on the n-th major diagonal of a matrix.apaMatrix.Diff.ColsReturns the column-wise n-th differences of a data matrix.apaMatrix.DifferenceGenerates the (first) difference matrix.apaMatrix.Diagonal.Major.PutReturns a square matrix of zeros with the elements of a vector on the major diagonal.apaMatrix.Diagonal.Major.Put.OnesSets all entries on the main diagonal of a matrix to one.apaMatrix.Drop.ColsRemoves columns of a matrix, given a vector of column indicators.apaMatrix.Drop.Cols.ByIndexRemoves columns of a matrix, given a vector of column indices.apaMatrix.Drop.RowsRemoves rows of a matrix, given a vector of row indicators.apaMatrix.Drop.Rows.ByIndexRemoves rows of a matrix, given a vector of row indices.apaMatrix.Flip.ColsReverses the order of the elements of a matrix in the horizontal direction.apaMatrix.Flip.RowsReverses the order of the elements of a matrix in the vertical direction.apaMatrix.FromVecPuts the elements of a vec vector into a square matrix.apaMatrix.FromVechPuts the elements of a vech vector, i.e. the lower triangular part including the main diagonal, into a square matrix.apaMatrix.FromVeclTurns a vecl vector, i.e. the lower vectorization of a square matrix excluding the main diagonal, into a matrix.apaMatrix.HankelBuilds a Hankel matrix from a data vector.apaMatrix.IdentityCreates an n x n identity matrix, i.e. a square matrix with ones on the main diagonal and zeros otherwise.apaMatrix.Inverse.PseudoReturns the Moore-Penrose pseudo-inverse of a matrix.apaMatrix.KronReturns the Kronecker product of two matrices.apaMatrix.LaggedReturns a matrix of lagged copies of data, defined by a vector of lags.apaMatrix.Lagged.nLagsReturns a matrix of lagged copies of data, defined by the maximum number of lags nLags.apaMatrix.Lagged.PadReturns a matrix of lagged copies of data, defined by a vector of lags.apaMatrix.LinspaceGenerates a linearly spaced 1 x nPoints vector.apaMatrix.LU.LReturns the L matrix of an LU decomposition.apaMatrix.LU.PReturns the P matrix of an LU decomposition.apaMatrix.LU.UReturns the U matrix of an LU decomposition.apaMatrix.MatrixProfile.WithIndexReturns the matrix profile and the 1-based matrix profile index for a univariate time series.apaMatrix.Max.ColsReturns the column maxima of a matrix.apaMatrix.Min.ColsReturns the column minima of a matrix.apaMatrix.MinorsReturns the matrix of all minors of a matrix.apaMatrix.Numeric.ColsReturns the columns of a matrix with numeric values only, i.e. series containing non-numeric elements are excluded.apaMatrix.Numeric.RowsReturns the rows of a matrix with numeric values only, i.e. data records containing non-numeric elements are excluded.apaMatrix.Normal.ColsNormalizes the columns of a matrix such that the lowest value is 0 and the highest value is 1.apaMatrix.Normal.RowsNormalizes the rows of a matrix such that the lowest value is 0 and the highest value is 1.apaMatrix.Normal.L2.ColsL2 normalization of all columns of a matrix: values are divided by the L2 norm of their column, such that all series are vectors of length one.apaMatrix.Normal.QuadraticTermNormalizes a square quadratic-term matrix by dividing all elements by a representative scale.apaMatrix.Normal.QuadraticTerm.ScaleReturns the representative scale used for quadratic-term normalization, i.e. the scalar normalization scale used by apaMatrix.Normal.QuadraticTerm.apaMatrix.Normal.Range.ColsNormalizes all columns of a matrix to a given lower and upper limit.apaMatrix.Normal.Range.RowsapaMatrix.OnesReturns an nRows x nCols matrix of ones.apaMatrix.PowerCalculates the power of a square matrix.apaMatrix.QR.QReturns the Q matrix of a QR decomposition.apaMatrix.QR.RReturns the R matrix of a QR decomposition.apaMatrix.RankReturns the rank of a matrix, i.e. the number of linearly independent rows or columns.apaMatrix.Remove.Duplicate.RowsRemoves the duplicate rows of a matrix.apaMatrix.Reorder.ColsReorders the columns of a matrix based on a vector of indices.apaMatrix.Reorder.RowsReorders the rows of a matrix based on a vector of indices.apaMatrix.Repeat.ColsRepeats a matrix n times in the horizontal direction.apaMatrix.Repeat.RowsRepeats a matrix n times in the vertical direction.apaMatrix.Replace.ExcelEmptyReplaces empty Excel cell values in a data matrix with another value.apaMatrix.Replace.ValueReplaces one value in a matrix.apaMatrix.Replace.ValuesReplaces given numbers in a data matrix with another value.apaMatrix.Replace.ZerosReplaces zero values in a data matrix with another value.apaMatrix.Scale.ColsScales the columns of a matrix such that their sums are all equal to a target value.apaMatrix.Scale.RowsScales the rows of a matrix such that their sums are all equal to a target value.apaMatrix.Scalar.Mult.MajDiagMultiplies the elements on the major diagonal of a matrix by a scalar.apaMatrix.Scalar.Mult.OffMajDiagMultiplies the elements off the major diagonal of a matrix by a scalar.apaMatrix.Select.ColsSelects columns of a matrix, given an indicator vector.apaMatrix.Select.Cols.ByCategorySelects the columns of a matrix which belong to a given category.apaMatrix.Select.Cols.ByIndexSelects columns of a matrix, given a vector of column indices.apaMatrix.Select.RowsSelects rows of a matrix, given an indicator vector.apaMatrix.Select.Rows.ByCategorySelects the rows of a matrix which belong to a given category.apaMatrix.Select.Rows.ByIndexSelects rows of a matrix, given a vector of row indices.apaMatrix.Select.Rows.NASelects rows of a matrix, given an indicator vector, and sets the data of the non-selected rows to #N/A.apaMatrix.Shift.CircularShifts a matrix in the horizontal and/or vertical direction by folding (circular shift).apaMatrix.Shuffle.ColsShuffles the columns of a matrix randomly.apaMatrix.Shuffle.RowsShuffles the rows of a matrix randomly.apaMatrix.Shift.PadShifts a matrix in the horizontal and/or vertical direction by padding zeros.apaMatrix.SolveLinearSolves a linear system of equations A*x = b.apaMatrix.Sort.Rows.ByFirstColumn.AscSorts the rows of a matrix by the values in its first column in ascending order.apaMatrix.Sort.Rows.ByFirstColumn.DesSorts the rows of a matrix by the values in its first column in descending order.apaMatrix.Sort.Rows.ByVector.AscSorts the rows of a matrix by the values in a vector in ascending order.apaMatrix.Sort.Rows.ByVector.DesSorts the rows of a matrix by the values in a vector in descending order.apaMatrix.Standard.ColsStandardizes the columns of a matrix such that their means are zero and their volatilities equal one.apaMatrix.Standard.RowsStandardizes the rows of a matrix such that their means are zero and their volatilities equal one.apaMatrix.Sums.CategoriesReturns the category sums of a data matrix.apaMatrix.Sums.ColsReturns the column sums of a matrix.apaMatrix.Sums.RowsReturns the row sums of a matrix.apaMatrix.SVD.SReturns the S matrix of a singular value decomposition (SVD).apaMatrix.SVD.UReturns the U matrix of a singular value decomposition (SVD).apaMatrix.SVD.VReturns the V matrix of a singular value decomposition (SVD).apaMatrix.TraceReturns the trace of a matrix.apaMatrix.ToeplitzBuilds a Toeplitz matrix from a data vector.apaMatrix.UniquesReturns all unique items of a matrix.apaMatrix.VecTurns a matrix into a column vector.apaMatrix.VechTurns the lower triangular part of a matrix, including the major diagonal, into a column vector.apaMatrix.VeclTurns the lower triangular part of a matrix, excluding the major diagonal, into a column vector.apaMatrix.Vecl.WithIndicesTurns the lower triangular part of a matrix, excluding the major diagonal, into a column vector.apaMatrix.ZerosReturns an nRows x nCols matrix of zeros.
apaMean 1
apaMean.ConfidenceIntervalsCalculates the confidence intervals for the mean (first moment) using a resampling methodology.
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
apaMeanCVaR.AssetsReturns a 2 x nAssets matrix with the average return of each asset in the first row and its conditional value at risk (CVaR) in the second row.apaMeanCVaR.Restricted.Bounded.Axb.FrontierCalculates the restricted and bounded mean-CVaR efficient frontier for a given confidence level, with optional additional linear equality and inequality constraints.apaMeanCVaR.Restricted.Bounded.Weights.FromCVaRReturns the composition of the restricted and bounded maximum return portfolio subject to a target CVaR.apaMeanCVaR.Restricted.Bounded.Weights.MinCVaRReturns the composition of the restricted and bounded minimum CVaR portfolio.apaMeanCVaR.Restricted.Bounded.FrontierCalculates the restricted and bounded mean-CVaR efficient frontier for a given confidence level.apaMeanCVaR.Restricted.Bounded.Weights.FromReturnReturns the composition of the restricted and bounded minimum CVaR portfolio subject to a target return.
apaMeanMAD 4
apaMeanMAD.Restricted.Bounded.Weights.FromMADReturns the composition of the restricted and bounded maximum return portfolio subject to a target MAD (mean absolute deviation).apaMeanMAD.Restricted.Bounded.Weights.MinMADReturns the composition of the restricted and bounded minimum MAD (mean absolute deviation) portfolio.apaMeanMAD.Restricted.Bounded.FrontierCalculates the restricted and bounded mean-MAD (mean absolute deviation) efficient frontier.apaMeanMAD.Restricted.Bounded.Weights.FromReturnReturns the composition of the restricted and bounded minimum MAD (mean absolute deviation) portfolio subject to a target return.
apaMeanMADD 4
apaMeanMADD.Restricted.Bounded.Weights.FromMADDReturns the composition of the restricted and bounded maximum return portfolio subject to a target MADD (mean absolute downside deviation).apaMeanMADD.Restricted.Bounded.Weights.MinMADDReturns the composition of the restricted and bounded minimum MADD (mean absolute downside deviation) portfolio.apaMeanMADD.Restricted.Bounded.FrontierCalculates the restricted and bounded mean-MADD (mean absolute downside deviation) efficient frontier.apaMeanMADD.Restricted.Bounded.Weights.FromReturnReturns the composition of the restricted and bounded minimum MADD (mean absolute downside deviation) portfolio subject to a target return.
apaMeanMADTD 4
apaMeanMADTD.Restricted.Bounded.Weights.FromMADTDReturns the composition of the restricted and bounded maximum return portfolio subject to a target MADTD (mean absolute downside threshold deviation).apaMeanMADTD.Restricted.Bounded.Weights.MinMADTDReturns the composition of the restricted and bounded minimum MADTD (mean absolute downside threshold deviation) portfolio.apaMeanMADTD.Restricted.Bounded.FrontierCalculates the restricted and bounded mean-MADTD (mean absolute downside threshold deviation) efficient frontier.apaMeanMADTD.Restricted.Bounded.Weights.FromReturnReturns the composition of the restricted and bounded minimum MADTD (mean absolute downside threshold deviation) portfolio subject to a target return.
apaMeanML 4
apaMeanML.Restricted.Bounded.Weights.FromMLReturns the composition of the restricted and bounded maximum return portfolio subject to a target ML (maximum loss).apaMeanML.Restricted.Bounded.Weights.MinMLReturns the composition of the restricted and bounded minimum ML (maximum loss) portfolio.apaMeanML.Restricted.Bounded.FrontierCalculates the restricted and bounded mean-ML (maximum loss) efficient frontier.apaMeanML.Restricted.Bounded.Weights.FromReturnReturns the composition of the restricted and bounded minimum ML (maximum loss) portfolio subject to a target return.
apaMeanVariance 48
apaMeanVariance.AssetsReturns a 2 x nAssets matrix with the average return of each asset in the first row and its volatility in the second row.apaMeanVariance.Restricted.Bounded.FrontierCalculates the mean-variance efficient frontier with Markowitz’s Critical Line Algorithm.apaMeanVariance.Restricted.Bounded.Frontier.AxbCalculates the bounded mean-variance efficient frontier with optional linear equality constraints A*w = b and optional linear inequality constraints, using the critical line algorithm.apaMeanVariance.Restricted.Bounded.Frontier.Axb.xQxcCalculates the bounded mean-variance efficient frontier with a quadratic constraint w'Q*w <= c and optional linear equality and inequality constraints, using the quadratic critical line algorithm.apaMeanVariance.Restricted.Bounded.Frontier.ResampledResamples points on the mean-variance efficient frontier generated by Markowitz’s Critical Line Algorithm.apaMeanVariance.Restricted.Bounded.Frontier.MorphingMorphs between a set of mean-variance efficient frontiers (Critical Line Algorithm).apaMeanVariance.Restricted.Bounded.Frontier.TrailingCalculates the mean-variance efficient frontier with Markowitz’s Critical Line Algorithm in a sequential (“trailing”) manner, one frontier per row of inputs.apaMeanVariance.Restricted.Bounded.Frontier.xQxcCalculates the bounded mean-variance efficient frontier with one additional quadratic constraint w'Q*w <= c.apaMeanVariance.Restricted.Bounded.Weights.FromReturnReturns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded mean-variance efficient portfolio with a given expected return, i.e.…apaMeanVariance.Transform.TurnoverReturns one input of a bounded mean-variance problem with current weights w0 and proportional transaction costs, transformed so that it can be solved with the…apaMeanVariance.Transform.Turnover.CollapseConverts the results of a problem transformed with apaMeanVariance.Transform.Turnover into final weights, trades, buys, sells or turnover.apaMeanVariance.Restricted.Bounded.Weights.FromRiskToleranceReturns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded mean-variance efficient portfolio for a given risk tolerance, i.e. the…apaMeanVariance.Restricted.Bnbounded.Weights.FromRiskToleranceReturns the weights of the restricted mean-variance efficient portfolio for a given risk tolerance, without bounds on the constituent weights.apaMeanVariance.Restricted.Bounded.Weights.FromVolatilityReturns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded mean-variance efficient portfolio with a given volatility, with…apaMeanVariance.Restricted.Bounded.Weights.MRPReturns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded maximum return portfolio with optional linear equality and inequality…apaMeanVariance.Restricted.Bounded.Weights.MSRReturns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded maximum Sharpe ratio portfolio with optional linear equality and…apaMeanVariance.Restricted.Bounded.Weights.MVPReturns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded minimum variance portfolio with optional linear equality and…apaMeanVariance.Restricted.Bounded.Weights.Resampled.FromRiskToleranceCalculates the composition of a resampled portfolio on the Markowitz mean-variance efficient frontier for a given risk tolerance, i.e. the average of the optimal portfolios across resampled inputs.apaMeanVariance.Restricted.Unbounded.FrontierCalculates the restricted and unbounded mean-variance efficient frontier, from the minimum variance portfolio up to a given maximum return.apaMeanVariance.Restricted.Unbounded.Hyperbola.CenterReturns the coordinates of the center of the hyperbola which describes the restricted and unbounded efficient frontier in return/volatility space.apaMeanVariance.Restricted.Unbounded.Hyperbola.SlopeReturns the slope of the asymptote of the hyperbola which describes the restricted and unbounded efficient frontier in return/volatility space.apaMeanVariance.Restricted.Unbounded.IR.FrontierCalculates the information ratio efficient frontier, i.e. the frontier of portfolios with maximum active return per unit of tracking error (TE) relative to a benchmark, in return/volatility space.apaMeanVariance.Restricted.Unbounded.IR.Frontier.ActiveReturnTESpaceCalculates the information ratio efficient frontier in active return/tracking error (TE) space.apaMeanVariance.Restricted.Unbounded.LinearEqualityConstraints.Axb.FrontierCalculates the restricted and unbounded mean-variance efficient frontier subject to general linear equality constraints A*w = b.apaMeanVariance.Restricted.Unbounded.LinearEqualityConstraints.Axb.Weights.FromReturnReturns the weights of the restricted and unbounded mean-variance efficient portfolio with a given return, subject to general linear equality constraints A*w = b.apaMeanVariance.Restricted.Unbounded.LinearEqualityConstraints.Axb.Weights.MVPReturns the weights of the restricted and unbounded minimum variance portfolio subject to general linear equality constraints A*w = b.apaMeanVariance.Restricted.Unbounded.LinearEqualityConstraints.FrontierCalculates the restricted and unbounded mean-variance efficient frontier subject to additional linear equality constraints on portfolio betas.apaMeanVariance.Restricted.Unbounded.LinearEqualityConstraints.Weights.FromReturnReturns the weights of the restricted and unbounded mean-variance efficient portfolio with a given return, subject to additional linear equality constraints on portfolio betas.apaMeanVariance.Restricted.Unbounded.LinearEqualityConstraints.Weights.MVPReturns the weights of the restricted and unbounded minimum variance portfolio subject to additional linear equality constraints on portfolio betas.apaMeanVariance.Restricted.Unbounded.Return.FromVolatilityCalculates the return of the restricted and unbounded frontier portfolio with a given volatility.apaMeanVariance.Restricted.Unbounded.TE.FrontierCalculates the constant tracking error (TE) frontier in return/volatility space, i.e. the efficient part of the TE ellipse around the benchmark.apaMeanVariance.Restricted.Unbounded.TE.Frontier.EllipseCalculates the constant tracking error (TE) ellipse around a benchmark portfolio in return/volatility space.apaMeanVariance.Restricted.Unbounded.TE.Frontier.SpecialPortfoliosReturns the volatility, return and composition of special portfolios on the constant tracking error (TE) frontier:apaMeanVariance.Restricted.Unbounded.TE.Weights.FromVolatilityReturns the composition of the portfolio on the constant tracking error (TE) frontier with a given volatility.apaMeanVariance.Restricted.Unbounded.Volatility.FromReturnCalculates the volatility of the restricted and unbounded frontier portfolio with a given return.apaMeanVariance.Restricted.Unbounded.Weights.FromVolatilityReturns the weights of the restricted and unbounded mean-variance efficient portfolio with a given volatility.apaMeanVariance.Restricted.Unbounded.Weights.FromReturnReturns the weights of the restricted and unbounded mean-variance efficient portfolio with a given return.apaMeanVariance.Restricted.Unbounded.Weights.FromRiskToleranceReturns the weights of the restricted and unbounded mean-variance efficient portfolio for a given risk tolerance.apaMeanVariance.Restricted.Unbounded.Weights.MSRReturns the weights of the restricted and unbounded maximum Sharpe ratio portfolio.apaMeanVariance.Restricted.Unbounded.Weights.MVPReturns the weights of the restricted and unbounded minimum variance portfolio.apaMeanVariance.Strategies.MostDiversified.Weights.FromCovarsReturns the constituent weights of the fully invested and long-only “most diversified” portfolio, i.e. the portfolio which maximizes the risk reduction from imperfectly correlated assets.apaMeanVariance.Strategies.RiskBudgeting.Weights.FromCovarsReturns the constituent weights of the fully invested and long-only risk budgeting portfolio, i.e. the portfolio which implements a target vector of percentage volatility contributions.apaMeanVariance.Strategies.RiskParity.Robust.Weights.FromCovarsReturns the constituent weights of the fully invested and long-only robust risk parity portfolio, i.e. the equal volatility contribution portfolio assuming equal correlations.apaMeanVariance.Strategies.RiskParity.Weights.FromCovarsReturns the constituent weights of the fully invested and long-only risk parity portfolio, i.e. the portfolio with equal contributions to portfolio volatility.apaMeanVariance.Strategies.RiskParity.Hierarchical.Weights.FromCovarsReturns the constituent weights of the fully invested and long-only hierarchical risk parity (HRP) portfolio.apaMeanVariance.Strategies.MaximumDecorrelation.FromCorrelsReturns the constituent weights of the fully invested and long-only maximum decorrelation portfolio, i.e. the portfolio which minimizes the aggregate correlation exposure.apaMeanVariance.Unrestricted.Unbounded.FrontierCalculates the unrestricted and unbounded mean-variance efficient frontier.apaMeanVariance.Unrestricted.Unbounded.Weights.FromReturnReturns the composition of the portfolio with a given return on the unrestricted and unbounded mean-variance efficient frontier.
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
apaMoments.All.Population.ShowStdevReturns a table with the first four moments of all assets (population versions): mean, standard deviation (volatility), skewness and excess kurtosis.apaMoments.All.Population.ShowVarianceReturns a table with the first four moments of all assets (population versions): mean, variance, skewness and excess kurtosis.apaMoments.RollingCalculates rolling moments of various types (raw, central, standardized).apaMoments.TimeAggregation.ContinuousCalculates the first four central and standardized moments of time-aggregated time series data.
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
apaNaturalSplineNatural spline interpolation.
apaNcdf 1
apaNcdfCumulative distribution function of the normal distribution, evaluated elementwise for a matrix of values.
apaNChooseK 3
apaNChooseK.AllReturns all combinations of k out of n items.apaNChooseK.CountCounts all possible combinations of k out of n items.apaNChooseK.RandomRandomly selects k out of n items.
apaNelsonSiegel 5
apaNelsonSiegel.ForwardRateCalculates the forward rate from Nelson-Siegel yield curve parameters.apaNelsonSiegel.PVCalculates the present value of a bond, in % of face value, discounted with a Nelson-Siegel term structure.apaNelsonSiegel.YieldCalculates the spot rate (yield) from Nelson-Siegel yield curve parameters.apaNelsonSiegel.EstimateEstimates the Nelson-Siegel parameters beta0, beta1, beta2 and tau1 by fitting observed yields.apaNelsonSiegel.ConstantTau.EstimateEstimates the Nelson-Siegel parameters beta0, beta1 and beta2 by fitting observed yields, for a given (constant) decay parameter tau1.
apaNelsonSiegelSvensson 4
apaNelsonSiegelSvensson.ForwardRateCalculates the forward rate from Nelson-Siegel-Svensson yield curve parameters.apaNelsonSiegelSvensson.PVCalculates the present value of a bond, in % of face value, discounted with a Nelson-Siegel-Svensson term structure.apaNelsonSiegelSvensson.YieldCalculates the spot rate (yield) from Nelson-Siegel-Svensson yield curve parameters.apaNelsonSiegelSvensson.EstimateEstimates the Nelson-Siegel-Svensson parameters beta0 to beta3, tau1 and tau2 by fitting observed yields.
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
apaNormalToLognormal.MeanConverts the mean and volatility of a normal variable into the mean of the corresponding lognormal variable.apaNormalToLognormal.VolatilityConverts the mean and volatility of a normal variable into the volatility of the corresponding lognormal variable.apaNormalToLognormal.CovarianceConverts the covariance of two normal variables into the covariance of the corresponding lognormal variables.apaNormalToLognormal.CorrelationConverts the correlation of two normal variables into the correlation of the corresponding lognormal variables.
apaNpdf 1
apaNpdf.MultivariateProbability density function of a multivariate normal distribution.
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
apaOneHotEncodingPerforms one-hot encoding on a categorical data vector.
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
apaPatternRecognition.ChangePoints.FromProfileReturns the top regime change candidates derived from a matrix profile index vector.apaPatternRecognition.ChangePoints.FromSeriesCalculates the matrix profile for a univariate time series and returns the top regime change candidates.apaPatternRecognition.ExpandProfile.ToSeriesExpands a matrix profile vector to the length of the original time series, using the minimum over all overlapping windows.apaPatternRecognition.GetWindowsDataReturns all overlapping subsequences (sliding windows) of a time series.apaPatternRecognition.MatrixProfileReturns the matrix profile and the 1-based matrix profile index for a univariate time series.apaPatternRecognition.MatrixProfile.AdjacencyMatrixReturns the self-join distance matrix between all subsequences of a time series, e.g. as input for graph functions.apaPatternRecognition.MotifExtraction.TopMotifPairs.FromProfileReturns the top non-overlapping motif pairs, i.e. the most similar pairs of subsequences, from matrix profile and matrix profile index vectors.apaPatternRecognition.MotifGroups.FromProfileReturns motif groups extracted from matrix profile and matrix profile index vectors using index-link grouping.apaPatternRecognition.MotifGroups.FromSeriesReturns motif groups extracted from a univariate time series using distance-based grouping.apaPatternRecognition.RegimeSegments.FromChangePointsBuilds contiguous regime segments from change point positions and scores.apaPatternRecognition.RegimeSegments.FromSeriesCalculates change points from a time series and returns contiguous regime segments.apaPatternRecognition.RegimeTrajectory.FromSeriesCalculates change points from a time series and returns the regime trajectory, i.e. the 1-based regime index for each observation.apaPatternRecognition.SegmentationProfile.FromProfileReturns the segmentation profile derived from a matrix profile index vector, i.e. a score for each position indicating the likelihood of a regime change.apaPatternRecognition.SegmentationProfile.FromSeriesCalculates the matrix profile for a univariate time series and returns the segmentation profile, i.e. a score for each position indicating the likelihood of a regime change.apaPatternRecognition.SelectTopNonRedundantShapeletsSelects the top non-redundant shapelets from a scored shapelet table, filtering shapelets with highly correlated distance profiles across the training series.apaPatternRecognition.ShapeletFeatures.FromDiscordsBuilds shapelets from discord start indices and returns distance-based shapelet features for a target time series.apaPatternRecognition.ShapeletFeatures.FromMotifsBuilds shapelets from motif start indices and returns distance-based shapelet features for a target time series.apaPatternRecognition.ShapeletFeatures.FromSeries.AutoDetermines motif and discord shapelets from a source time series and returns distance-based shapelet features for a target time series.apaPatternRecognition.ShapeletScoresBinaryScores candidate shapelets for binary classification, based on the separation of the best-match distances between training series with label 0 and label 1.apaPatternRecognition.ShapeletScoresBinary.AutoDetermines motif- and discord-derived candidate shapelets from a source time series and scores them for binary classification.apaPatternRecognition.TopDiscords.FromProfileReturns the top non-overlapping discords, i.e. the most unusual subsequences, from matrix profile and matrix profile index vectors.apaPatternRecognition.TopDiscords.FromSeriesCalculates the matrix profile for a univariate time series and returns the top non-overlapping discords, i.e. the most unusual subsequences.apaPatternRecognition.WindowPatternFeaturesBuilds features for each subsequence window from motif groups, discords and optionally change points, e.g. as input for classification or regression models.apaPatternRecognition.WindowPatternFeatures.FromSeriesCalculates motif groups, discords and change points from a time series and returns features for each subsequence window.
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
apaPiecewiseRegression.BapaPiecewiseRegression.R2apaPiecewiseRegression.ResapaPiecewiseRegression.XapaPiecewiseRegression.X.BreakpointsReturns the X variables (design matrix) of a piecewise linear regression with connected segments, defined by n breakpoints.apaPiecewiseRegression.Yhat
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
apaPolynomial.RootsReturns all real and complex roots of a polynomial with integer exponents.
apaPortfolio 3
apaPortfolio.Resampled.MeanReturnResamples the asset returns and calculates the mean and the lower/upper confidence bounds of the portfolio mean return.apaPortfolio.Resampled.VolatilityResamples the asset returns and calculates the mean and the lower/upper confidence bounds of the portfolio volatility.apaPortfolio.Resampled.VolatilityContrResamples the asset returns and calculates the mean and the lower/upper confidence bounds of the portfolio volatility contributions.
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
apaPrivateMarkets.Simulate.Fund.MultiPathRuns a multi-path private fund J-curve simulation for a single fund parameter set and returns the assumptions and percentile summaries across simulation paths.apaPrivateMarkets.Simulate.Portfolio.SharedFactor.OnePathRuns a one-path portfolio private fund J-curve simulation with fund-specific shared-factor betas, using a fund parameter matrix and common shocks across funds.apaPrivateMarkets.Simulate.Fund.OnePathRuns a single-path private fund J-curve simulation with a parameter vector and returns the assumptions and the full time series output.apaPrivateMarkets.Simulate.Portfolio.MultiPathRuns a multi-path (Monte Carlo) portfolio private fund J-curve simulation for a matrix of fund parameters and returns percentile summaries.apaPrivateMarkets.Simulate.Portfolio.SharedFactor.MultiPathRuns a multi-path portfolio private fund J-curve simulation with fund-specific shared-factor betas and returns percentile summaries across paths.apaPrivateMarkets.Simulate.Portfolio.OnePathRuns a one-path portfolio private fund J-curve simulation for a matrix of fund parameters.
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
apaRandomForest.Regression.MDICalculates the random forest regression feature importance as mean decrease in impurity (MDI).apaRandomForest.Regression.PredictionsWithIntervalsReturns random forest regression predictions with confidence intervals.apaRandomForest.Regression.R2Returns the R-squared of a random forest regression.apaRandomForest.Regression.Timeseries.ForecastWithIntervalsRandom forest time series regression: returns forecasts with confidence intervals.apaRandomForest.Regression.Timeseries.R2Random forest time series regression: returns the R-squared.apaRandomForest.Regression.YhatWithIntervalsAndResidualsRandom forest regression: returns the fitted Y values, their confidence intervals and the residuals.
apaRandomWeights 3
apaRandomWeights.RestrictedGenerates random allocations subject to lower and upper bounds and a constraint on total exposure.apaRandomWeights.Restricted.SubspaceGenerates random allocations subject to lower and upper bounds and a constraint on total exposure.apaRandomWeights.FilterExtracts the allocations which are within given lower and upper bounds.
apaRating 2
apaRating.EndingAllocationCalculates the expected ending rating allocation, given an initial allocation and a rating transition matrix.apaRating.TransitionMatrix.CompoundCompounds (extrapolates) a rating transition matrix over n years.
apaRegimes 2
apaRegimes.States.FromResponsibilitiesDerives the state trajectory vector from a matrix of responsibilities, i.e. the most probable state of each observation.apaRegimes.TransitionMatrix.FromStatesCalculates the transition matrix from a state trajectory vector.
apaRegression 5
apaRegression.Betas.kFoldApplies given regression betas to k-folded data.apaRegression.FittedCalculates the fitted Y values from X and given betas.apaRegression.MSECalculates the mean squared error (MSE) from X, Y and given betas.apaRegression.R2Calculates the R-squared from X, Y and given betas.apaRegression.ResidualsCalculates the residuals from X, Y and given betas.
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
apaResample.TimeSeriesResamples a time series with replacement (bootstrap), optionally as a stationary block bootstrap, generating several resampled series.apaResample.TimeSeries.WithoutReplacementResamples (shuffles) a time series without replacement, generating several resampled series.apaResample.TimeSeriesMatrixResamples the rows of a time series matrix with replacement (bootstrap), optionally as a stationary block bootstrap, i.e. preserving the dependency structure of multivariate data.apaResample.TimeSeriesMatrix.WithoutReplacementResamples (shuffles) the rows of a time series matrix without replacement, preserving the cross-sectional dependence.
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
apaReturn.Annualize.FromDatesAnnualizes a return figure calculated over the period from a start date to an end date.apaReturn.Average.Continuous.FromWeightsCalculates portfolio returns from constituent weights and returns.apaReturn.IRRCalculates the money-weighted return, also known as internal rate of return (IRR) or dollar-weighted return, from a beginning and an ending market value and cash in- and outflows.apaReturn.IRR.AllCalculates all real and complex IRR solutions.apaReturn.IRR.AvgCapitalCalculates the average capital invested which is implied by the money-weighted return (IRR).apaReturn.ModifiedDietzCalculates the time-weighted return according to the Modified Dietz methodology.apaReturn.ModifiedDietz.AvgCapitalCalculates the average capital invested according to the Modified Dietz methodology.apaReturn.DietzCalculates the time-weighted return according to the original Dietz methodology.apaReturn.Dietz.AvgCapitalCalculates the average capital invested according to the original Dietz methodology.apaReturn.ProfitLossCalculates the profit or loss from beginning and ending market values and cash flows.
apaReturns 33
apaReturns.FromAllocations.GrossCalculates portfolio returns from asset returns and allocations, without considering transaction costs.apaReturns.FromAllocations.NetCalculates portfolio returns from asset returns and allocations, net of transaction costs, assuming either equal costs for all assets or asset-specific costs.apaReturns.Means.ArithmeticReturns the arithmetic means of a time series matrix.apaReturns.Means.Arithmetic.JaggedReturns the arithmetic means of a jagged time series matrix.apaReturns.Means.ExpWeightedReturns the exponentially weighted means of a time series matrix.apaReturns.Means.GeometricReturns the geometric means of a time series matrix.apaReturns.Means.Geometric.JaggedReturns the geometric means of a jagged time series matrix.apaReturns.BearReturns the bear market returns, i.e. the portfolio returns when the benchmark return is negative.apaReturns.BoomBustIdentifies retrospective boom and bust phases of a return time series, based on high-water-mark drawdown episodes.apaReturns.BullReturns the bull market returns, i.e. the portfolio returns when the benchmark return is larger than or equal to zero.apaReturns.ContinuousToDiscreteConverts continuous returns into discrete returns.apaReturns.Cumulative.ArithmeticReturns the cumulative return based on continuous subperiod returns, i.e. arithmetic sums.apaReturns.Cumulative.GeometricReturns the cumulative return based on discrete subperiod returns, i.e. chain-linking.apaReturns.FromConstWeightsCalculates portfolio return time series from a matrix of constant constituent weights and a matrix of constituent returns.apaReturns.FromWeightsCalculates a portfolio return time series from time-varying weights and returns.apaReturns.FromPricesConverts prices into discrete or continuous returns.apaReturns.DiscreteToContinuousConverts discrete returns into continuous returns.apaReturns.DownReturns the down market returns, i.e. all negative returns.apaReturns.HoldingPeriods.ArithmeticCalculates the cumulative arithmetic returns for all possible holding periods.apaReturns.HoldingPeriods.GeometricCalculates the cumulative geometric (chain-linked) returns for all possible holding periods.apaReturns.RandomGenerates a 1 x nAssets vector of uniformly distributed random returns between -100% and +100%.apaReturns.RollingReturns the data of a particular rolling window.apaReturns.Rolling.AllReturns all rolling windows, each column containing a window.apaReturns.Rolling.NumberOfWindowsDetermines the number of rolling windows which can be calculated.apaReturns.Shrink.HiShrinks a vector of cross-sectional returns towards the highest return.apaReturns.Shrink.LoShrinks a vector of cross-sectional returns towards the lowest return.apaReturns.Shrink.MeanShrinks a vector of cross-sectional returns towards the mean return.apaReturns.Simulate.ARMA22Simulates returns which follow an ARMA(2,2) process.apaReturns.Simulate.GARCH11Simulates returns which follow a GARCH(1,1) process.apaReturns.Simulate.GBMSimulates returns which follow a geometric Brownian motion.apaReturns.LowerExtracts the lower returns, defined as the conditional portfolio returns rp | rb < Threshold.apaReturns.UpperExtracts the upper returns, defined as the conditional portfolio returns rp | rb >= Threshold.apaReturns.UpReturns the up market returns, i.e. all positive returns.
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
apaShortfallProb.EmpiricalReturns the empirical probability of falling short of a given threshold, i.e. the share of observations below the threshold.apaShortfallProb.ConfidenceIntervalsCalculates non-parametric confidence intervals for the shortfall probability based on resampling.
apaShrinkageEstimator 7
apaShrinkageEstimator.Covars.JorionJorion Bayesian shrinkage estimator for covariances.apaShrinkageEstimator.Covars.LedoitWolf.ConstantCorrelationsLedoit/Wolf constant correlation Bayesian shrinkage estimator for covariances.apaShrinkageEstimator.Covars.LedoitWolf.GeometricInverseLedoit/Wolf geometric inverse shrinkage (GIS) estimator for covariances, a non-linear shrinkage estimator.apaShrinkageEstimator.Covars.LedoitWolf.LinearInverseLedoit/Wolf linear inverse shrinkage (LIS) estimator for covariances, a non-linear shrinkage estimator.apaShrinkageEstimator.Covars.LedoitWolf.QuadraticInverseLedoit/Wolf quadratic inverse shrinkage (QIS) estimator for covariances, a non-linear shrinkage estimator.apaShrinkageEstimator.ExpectedReturns.JamesSteinJames/Stein Bayesian shrinkage estimator for expected returns.apaShrinkageEstimator.ExpectedReturns.JorionJorion Bayesian shrinkage estimator for expected returns.
apaSimilarities 3
apaSimilarities.CorrelDerives a similarity matrix from a correlation matrix.apaSimilarities.CosineDerives the cosine similarity matrix from a data matrix.apaSimilarities.FromDistancesDerives a similarity matrix from a distance matrix.
apaSingleIndexModel 5
apaSingleIndexModel.XReturns the matrix of independent variables of a particular single index model specification.apaSingleIndexModel.BReturns the vector of estimated parameters of a particular single index model specification.apaSingleIndexModel.YhatReturns the vector of fitted portfolio returns of a particular single index model specification.apaSingleIndexModel.ResReturns the vector of residuals of a particular single index model specification.apaSingleIndexModel.R2Returns the R-squared of a particular single index model specification.
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
apaSummary.FiveNumber.CrosssectionalReturns the cross-sectional five-number summary of a time series matrix.apaSummary.FiveNumber.TimeseriesReturns the time-series five-number summary of a time series matrix.apaSummary.SevenNumber.CrosssectionalReturns the cross-sectional seven-number summary of a time series matrix.apaSummary.SevenNumber.TimeseriesReturns the time-series seven-number summary of a time series matrix.
apaSystem 3
apaSystem.PerformanceA test function returning an indicator of the computer system performance.apaSystem.Custom.InstallInstalls a custom version of the add-in.apaSystem.UpdateInitiates the update procedure manually, updating the add-in to the latest release available.
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
apaTemporal.AggregationAggregates high frequency data into low frequency data by summing the high frequency observations of each low frequency period (additive aggregation).apaTemporal.Aggregation.MatrixGenerates a temporal aggregation matrix of size nLoFreqPeriods x nHiFreqPeriods.apaTemporal.Aggregation.Matrix.FirstGenerates a temporal aggregation matrix which selects the first high frequency observation of each low frequency period, i.e. “spaces out” observations.apaTemporal.Aggregation.Returns.ContinuousLegacy function to time-aggregate continuous returns.apaTemporal.Aggregation.Returns.DiscreteLegacy function to time-aggregate discrete returns.apaTemporal.Disaggregation.BrownianBridgeTemporally disaggregates data by Brownian bridge interpolation.apaTemporal.Disaggregation.ChowLinTemporally disaggregates low frequency data into high frequency data by modeling the dynamics with high frequency indicator variables and assuming an AR(1) process in the residuals (Chow/Lin method).apaTemporal.Disaggregation.DiagonalTemporally disaggregates low frequency data into high frequency data by modeling the dynamics with high frequency indicator variables and assuming uncorrelated (diagonal) residuals.apaTemporal.Disaggregation.FernandezTemporally disaggregates low frequency data into high frequency data by modeling the dynamics with high frequency indicator variables and assuming a random walk in the residuals (Fernandez method).apaTemporal.Disaggregation.LittermanTemporally disaggregates low frequency data into high frequency data by modeling the dynamics with high frequency indicator variables and assuming ARIMA(1,1,0) residuals (Litterman method).apaTemporal.kFold.DataReturns a particular data set when k-folding data.apaTemporal.kFold.nRemaindersReturns the k values resulting in a given number of remainder observations.apaTemporal.kFold.SizesReturns the sizes of the various data sets when k-folding data.apaTemporal.Window.DataReturns a particular data set when rolling windows through data.apaTemporal.Window.SizesReturns various data set sizes when rolling windows: 1) number of data sets, 2) number of remainder observations.apaTemporal.Window.TimeIdx.AllReturns all time indices (row numbers) of a particular rolling window, either of the in-sample or of the out-of-sample window.apaTemporal.Window.TimeIdx.FirstReturns the first time index (row number) of a particular rolling window, either of the in-sample or of the out-of-sample window.apaTemporal.Window.TimeIdx.LastReturns the last time index (row number) of a particular rolling window, either of the in-sample or of the out-of-sample window.
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
apaTrackingError.Contributions.ActiveWeightsReturns the marginal tracking errors, the contributions to tracking error and the percentage contributions to tracking error, given a vector of active weights and constituent returns.apaTrackingError.FromActiveWeightsCalculates the tracking error from active weights and constituent returns.apaTrackingError.FromActiveWeightsReturnsCalculates the tracking error from portfolio and benchmark weights, if the constituent returns of portfolio and benchmark are different.apaTrackingErrorReturns the tracking error of a portfolio, calculated from active returns.
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
apaTree.LayoutCalculates a tree layout from an edge list.
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
apaUlcerPerformanceIndexCalculates the Ulcer Performance Index (Martin ratio), a risk-adjusted performance measure.
apaUPM 1
apaUPMReturns the upper partial moment (UPM) of a return time series.
apaUpsidePotentialRatio 1
apaUpsidePotentialRatioReturns the upside potential ratio, a risk-adjusted performance measure.
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
apaVectorAutoregress.BetasCalculates the OLS betas of a vector autoregressive (VAR) model of order p.apaVectorAutoregress.Betas.tValueReturns the t-values of the estimated OLS betas of a vector autoregressive (VAR) model of order p.apaVectorAutoregress.CompanionMatrixReturns the companion matrix of a vector autoregressive (VAR) model, derived from the VAR betas.apaVectorAutoregress.FittedReturns the fitted values of a vector autoregressive (VAR) model of order p.apaVectorAutoregress.ForecastReturns forecasts from a vector autoregressive (VAR) model of order p.apaVectorAutoregress.Forecast.WithDataReturns forecasts from a vector autoregressive (VAR) model of order p, appended to the existing data.apaVectorAutoregress.ImpulseResponseReturns the impulse responses of a vector autoregressive (VAR) model of order p, i.e. the projected response of all variables to a unit shock in one variable.apaVectorAutoregress.R2Returns the overall R-squared of a vector autoregressive (VAR) model of order p.apaVectorAutoregress.R2sReturns the R-squared of each equation of a vector autoregressive (VAR) model of order p.apaVectorAutoregress.ResidualsReturns the residuals of a vector autoregressive (VAR) model of order p.apaVectorAutoregress.XReturns the X data matrix of a vector autoregressive (VAR) model of order p.
apaVersion 2
apaVersion.InstalledReturns the version of the installed add-in.apaVersion.CurrentReturns the latest version of the add-in available.
apaVolatilities 12
apaVolatilitiesReturns the ex post volatilities of several time series.apaVolatilities.ExpWeightedReturns the ex post exponentially weighted volatilities of a time series matrix.apaVolatilities.FromCovarsReturns the volatilities contained in a covariance matrix, i.e. the square roots of the diagonal elements.apaVolatilities.JaggedReturns the ex post volatilities of all columns of a jagged data matrix.apaVolatilities.RandomGenerates a 1 x nAssets vector of uniformly distributed random volatilities between 0% and 100%.apaVolatilities.MatchObservedCVaRsFinds the normal volatilities which reproduce given conditional values at risk (CVaR), given the means and a confidence level.apaVolatilities.MatchObservedVaRsFinds the normal volatilities which reproduce given values at risk (VaR), given the means and a confidence level.apaVolatilities.Shrink.HiShrinks a vector of cross-sectional volatilities towards the highest volatility.apaVolatilities.Shrink.LoShrinks a vector of cross-sectional volatilities towards the lowest volatility.apaVolatilities.Shrink.MeanShrinks a vector of cross-sectional volatilities towards the mean volatility.apaVolatilities.SpecificCalculates the specific (idiosyncratic) volatilities relative to an index, i.e. the volatilities of the single index model residuals.apaVolatilities.Specific.PercentageCalculates the specific (idiosyncratic) volatilities relative to an index as a percentage of total volatility.
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.
