math and statistics functions

Does anybody have any math (non-linear regression) or statistics functions they would be willing to share. I have a project and I’m looking for some good math libraries. I’ve had no luck integrating some others.

I’m looking for
T-Test
Correlation
Chi Square
Anova
Non-Linear Regression
etc. kinds of things.

Thanks for any pointers.

Since the comments don’t let me add code, here is a demo C# script I used to make sure Math.NET worked.

using UnityEngine;
using System.Collections;
using MathNet.Numerics;
public class MathNETTest : MonoBehaviour {

	// Use this for initialization
	void Start ()
	{
        Debug.Log(Trig.Cosine(Mathf.PI));
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

This needs to be inside a file called MathNETTest.cs, and it should log a number very close to -1.

Have you seen Math.NET? It seems to have what you want. However, I think that is for the CLR. You will need to try it.

Just to complete macfanpro’s answer, here’s his example in Unityscript:

import MathNet.Numerics;

function Start ()
{
    Debug.Log(Trig.Cosine(Mathf.PI));
    // or
    Debug.Log(MathNet.Numerics.Trig.Cosine(Mathf.PI));
}

You could use Math.NET for Unity (see https://forum.unity3d.com/threads/coming-soon-math-net-for-unit.444045/#post-2871830) which is a port of the latest version of Math.NET Numerics.