You are here: Symbol Reference > Dew.Stats Namespace > Statistics Class > Statistics Methods > BetaFit Method > BetaFit Method (TVec, TSample, TSample, TTwoElmReal, TTwoElmReal, Integer, TSample, TSample)
Dew Stats for .NET
Contents
C# Example

The following example generates 100 random Beta distributed values and then uses BetaFit routine to extract used a and b parameters:

using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples;
{
  private void Example()
  {
    Vector v = new Vector(1000,false);
    // first, generate 1000 randomly beta distributed
    // numbers with parameters a=3 and b =2
    StatRandom.RandomBeta(3.0, 2.0, v);
    double esta,estb;
    double[2] cia,cib;
    // Now extract the a,b and their 95% confidence intervals.
    //Use at max 300 iterations and tolerance 0.001
    Statistics.BetaFit(v,out esta, out estb, out cia, out cib, 300, 1.0e-3, 0.05);
Copyright (c) 1999-2010 by Dew Research. All rights reserved.