Browse Source

ExcelFunctions: TargetedPatchingOptOut

provider
Christoph Ruegg 13 years ago
parent
commit
0fdd24fa0e
  1. 19
      src/Numerics/ExcelFunctions.cs

19
src/Numerics/ExcelFunctions.cs

@ -32,6 +32,10 @@ using System;
using MathNet.Numerics.Distributions;
using MathNet.Numerics.Statistics;
#if !PORTABLE
using System.Runtime;
#endif
// ReSharper disable InconsistentNaming
namespace MathNet.Numerics
@ -44,26 +48,31 @@ namespace MathNet.Numerics
/// </summary>
public static class ExcelFunctions
{
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double NormSDist(double z)
{
return Normal.CDF(0d, 1d, z);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double NormSInv(double probability)
{
return Normal.InvCDF(0d, 1d, probability);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double NormDist(double x, double mean, double standardDev, bool cumulative)
{
return cumulative ? Normal.CDF(mean, standardDev, x) : Normal.PDF(mean, standardDev, x);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double NormInv(double probability, double mean, double standardDev)
{
return Normal.InvCDF(mean, standardDev, probability);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double TDist(double x, int degreesFreedom, int tails)
{
switch (tails)
@ -77,41 +86,49 @@ namespace MathNet.Numerics
}
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double TInv(double probability, int degreesFreedom)
{
return -StudentT.InvCDF(0d, 1d, degreesFreedom, probability/2);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double FDist(double x, int degreesFreedom1, int degreesFreedom2)
{
return 1d - FisherSnedecor.CDF(degreesFreedom1, degreesFreedom2, x);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double FInv(double probability, int degreesFreedom1, int degreesFreedom2)
{
return FisherSnedecor.InvCDF(degreesFreedom1, degreesFreedom2, 1d - probability);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double BetaDist(double x, double alpha, double beta)
{
return Beta.CDF(alpha, beta, x);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double BetaInv(double probability, double alpha, double beta)
{
return Beta.InvCDF(alpha, beta, probability);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double GammaDist(double x, double alpha, double beta, bool cumulative)
{
return cumulative ? Gamma.CDF(alpha, 1/beta, x) : Gamma.PDF(alpha, 1/beta, x);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double GammaInv(double probability, double alpha, double beta)
{
return Gamma.InvCDF(alpha, 1/beta, probability);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double Quartile(double[] array, int quant)
{
switch (quant)
@ -131,11 +148,13 @@ namespace MathNet.Numerics
}
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double Percentile(double[] array, double k)
{
return array.QuantileCustom(k, QuantileDefinition.Excel);
}
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public static double PercentRank(double[] array, double x)
{
return array.QuantileRank(x, RankDefinition.Min);

Loading…
Cancel
Save