Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Statistics::Forecast 0.3

    Download button

    No screenshots available
    Downloads: 590  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Alex Falcao | More programs
    Perl Artistic License / FREE
    May 23rd, 2007, 20:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Statistics::Forecast description

    Statistics::Forecast is a Perl module that calculates a future value.

    Statistics::Forecast is a Perl module that calculates a future value.

    This is a dummy Oriented Object module that calculates a future value by using existing values. The new value is calculated by using linear regression.

    SYNOPSIS

    use Statistics::Forecast;

    Create forecast object

    my $FCAST = Statistics::Forecast->new("My Forecast Name");

    Add data

    $FCAST->{DataX} = @Array_X;
    $FCAST->{DataY} = @Array_Y;
    $FCAST->{NextX} = $NextX;

    Calculate the result

    $FCAST->calc;

    Get the result

    my $Result_Forecast = $FCAST->{ForecastY);

    INTERNALS

    The equation for Forecast is:
    a+bx, where 'x' is the predicted value and
    _ _
    a = y + bx

    b = sum((x+x)(y-y))/sum(x-x)**2

    METHODS

    new

    Receives a forecast name, only to remember and returns the blessed data structure as a Statistics::Forecast object.
    my $FCAST = Statistics::Forecast->new("My Forecast");

    calc

    Calculate and return the forecast value.
    $FCAST->calc;

    dump

    Prints data for debuging propose.
    $FCAST->dump;

    SumX

    Returns the sum of X values.
    my $SumOfX = $FCAST->{SumX};

    SumY

    Returns the sum of Y values.
    my $SumOfY = $FCAST->{SumY};

    SumXX

    Returns the sum of X**2 values.
    my $SumOfXX = $FCAST->{SumXX};

    SumXY

    Returns the sum of X * Y values.
    my $SumOfXY = $FCAST->{SumXY};

    AvgX

    Returns the average of X values.
    my $AvgX = $FCAST->{AvgX};

    AvgY

    Returns the average of Y values.
    my $AvgY = $FCAST->{AvgY};

    N

    Return the number of X values.
    my $N = $FCAST->{N};

    EXAMPLE

    use Statistics::Forecast;

    my @Y = (1,3,7,12);
    my @X = (1,2,3,4);

    my $FCAST = Statistics::Forecast->new("My Forecast");

    $FCAST->{DataX} = @X;
    $FCAST->{DataY} = @Y;
    $FCAST->{NextX} = 8;
    $FCAST->calc;

    print "The Forecast ", $FCAST->{ForecastName};
    print " has the forecast value: ", $FCAST->{ForecastY}, "n";

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    future value | calculate values | forecast statistics | Statistics::Forecast | calculate | future

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM