Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

hursttst.cpp

Go to the documentation of this file.
00001 
00008 
00009 #include <assert.h>
00010 #include <stdio.h>
00011 
00012 #include "rescaled_range.h"
00013 
00017 static double v[] = {
00018   // Test data set with a Hurst value of 7.2
00019 #include "data/brown72.h"
00020   // Test data set with a Hurst value of 8.0
00021   // #include "data/fgn8_1024.h"
00022 };
00023 
00024 // Number of elements
00025 const size_t N = sizeof( v ) / sizeof( double );
00026 
00027 
00028 int
00029 main()
00030 {
00031   rescaled_range hurst;
00032   rescaled_range::hurstInfo info;
00033 
00034   size_t n = N;  
00035 
00036   hurst.calc_hurst_est( v, n, info );
00037 
00038   const size_t len = (info.points()).size();
00039   for (size_t i = 0; i < len; i++) {
00040     printf("%7.4f  %7.4f\n", (info.points())[i].x(), (info.points())[i].y());
00041   }
00042   printf("slope = %7.4f +- %7.4f, intercept = %7.4f\n", 
00043          info.slope(), info.slopeErr(), info.intercept() );
00044   return 0;
00045 }

Generated at Thu May 22 21:12:35 2003 for Hurst Exponent Calculation and Supporting Statistics by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001