I am currently using Fit.MultiDim from Math.NET to calculate an estimated value for a data set that has 2 dimensions like so:
using MathNet.Numerics;
using System.Collections.Generic;
using System.Linq;
namespace Project
{
public class Program
{
public static void Main(string[] args)
{
var xPoints = new List<List<double>>
{
new List<double> {2000, 100},
new List<double> {2002, 60},
new List<double> {2004, 50},
new List<double> {2006, 30},
};
var yPoints = new List<double> { 50, 60, 70, 80 };
var multiFit = Fit.MultiDim(
xPoints.Select(item => item.ToArray()).ToArray(),
yPoints.ToArray(),
intercept: true
);
// multiFit = [-9949.999999999998,4.999999999999999,0.0]
var inputDimension1 = 2003;
var inputDimension2 = 55;
var expectedY = multiFit[0] + inputDimension1 * multiFit[1] + inputDimension2 * multiFit[2];
// expectedY = 65
}
}
}
How do I update the logic to be able to specify which percentile I want to calculate the value for? Let's say I want to get a value for 25% and 75%.
I know that the library has Percentile
and Quantile
methods but I don't have any knowledge in statistics so have no idea how to apply it to my use case.