public ArtaStatistics(ArtaExecutionContext context, int lag, int iterations) { this.context = context; this.correlationCoefficients = context.ArtaCorrelationCoefficients; this.lag = lag; this.iterations = iterations; }
public void Initialize() { var corr1 = _data.Properties.GetProperty("CorrelationCoefficient"); correlationCoefficient = corr1.GetDoubleValue(_data.ExecutionContext); artaExecutionContext = new ArtaExecutionContext(ArtaExecutionContext.Distribution.ExponentialDistribution, new double[] { correlationCoefficient }); }
static void Main(string[] args) { var context = new ArtaExecutionContext(ArtaExecutionContext.Distribution.ExponentialDistribution, new double[] { 0.4 }); var test = new ArtaStatistics(context).Initialize(10).Iterations(1000).Acfs().Excecute(); Console.ReadKey(); }
private void Execute(object obj) { var context = new ArtaExecutionContext((ArtaExecutionContext.Distribution)Distribution, new double[] { correlationCoefficient }); var artaProcess = context.ArtaProcess; ArtaNumbers = new ObservableCollection <double>(); for (int i = 0; i < Iterations; i++) { ArtaNumbers.Add(artaProcess.Next()); } }
private void Execute(object obj) { ErrorIsVisible = Visibility.Hidden; if (!InputIsValid()) { return; } ArtaNumbers.Clear(); Acfs.Clear(); Pacfs.Clear(); try { var context = new ArtaExecutionContext((ArtaExecutionContext.Distribution)Distribution, new double[] { correlationCoefficient }); var artaProcess = context.ArtaProcess; artaNumbers = new double[iterations]; artaNumbers = new double[iterations]; for (var i = 0; i < Iterations; i++) { artaNumbers[i] = artaProcess.Next(); ArtaNumbers.Add(new ListHelper(artaNumbers[i], 0, 0)); } acfs = AutoCorrelation.CalculateAcfs(artaNumbers, lag); foreach (var item in acfs) { Acfs.Add(new ListHelper(0, item, 0)); } pacfs = AutoCorrelation.CalculatePacfs(acfs); foreach (var item in pacfs) { Pacfs.Add(new ListHelper(0, 0, item)); } Order = OrderEstimator.EstimateOrder(artaNumbers, lag); ExportIsEnabled = true; } catch (Exception exception) { ErrorMessage = exception.Message; ErrorIsVisible = Visibility.Visible; } }
public ArtaStatistics(ArtaExecutionContext context) { this.context = context; this.correlationCoefficients = context.ArtaCorrelationCoefficients; }
public static void Main(String[] args) { var executionContext = new ArtaExecutionContext(BaseDistribution.Distribution.ExponentialDistribution, new double[] { 0, 0 }); ArtaStatistics arta = new ArtaStatistics(executionContext).Initialize(10).Iterations(1000).ArtaNumbers().Acfs().Pacfs().Excecute(); /* * double[] arNumbers = new double[1500]; * for(int i = 0; i < arNumbers.Length; i++) * { * arNumbers[i] = executionContext.ArtaProcess.GetArProcess().Next(); * } * * * int lag = 10; * * double[] artaNumbers = new double[1500]; * for (int i = 0; i < artaNumbers.Length; i++) * { * artaNumbers[i] = executionContext.ArtaProcess.Next(); * } * * double[] test = new double[100]; * Normal nDist = new Normal(); * for (int i = 0; i < test.Length; i++) * { * test[i] = nDist.Sample(); * } * * double[] acfs = AutoCorrelation.CalculateAcfs(artaNumbers, lag); * double[] pacfs = AutoCorrelation.CalculatePacfs(acfs); * * StringBuilder distriOut = new StringBuilder(); * var contPath = @"C:\Users\Philipp\Desktop\arNumbers.csv"; * foreach (var coeff in arNumbers) * { * distriOut.Append(coeff + "\n"); * * * } * File.AppendAllText(contPath, distriOut.ToString()); * * StringBuilder artaOut = new StringBuilder(); * var artaPath = @"C:\Users\Philipp\Desktop\outArtaStdCont.csv"; * foreach (var coeff in artaNumbers) * { * artaOut.Append(coeff + "\n"); * * * } * File.AppendAllText(artaPath, artaOut.ToString()); * * StringBuilder pacfsOut = new StringBuilder(); * var artaPacfsPath = @"C:\Users\Philipp\Desktop\PacfsARTAStd.csv"; * foreach (var coeff in pacfs) * { * pacfsOut.Append(coeff + "\n"); * * * } * File.AppendAllText(artaPacfsPath, pacfsOut.ToString()); * * * StringBuilder acfsOut = new StringBuilder(); * var artaAcfsPath = @"C:\Users\Philipp\Desktop\AcfsARTAStd.csv"; * foreach (var coeff in acfs) * { * acfsOut.Append(coeff + "\n"); * * * } * File.AppendAllText(artaAcfsPath, acfsOut.ToString()); * Console.WriteLine(nDist.Variance); */ Console.ReadKey(); }