NAME

    Math::LOESS - Perl wrapper of the Locally-Weighted Regression package
    originally written by Cleveland, et al.

VERSION

    version 0.0000_03

SYNOPSIS

        use Math::LOESS;
    
        my $loess = Math::LOESS->new(x => $x, y => $y);
    
        $loess->fit();
        my $fitted_values = $loess->outputs->fitted_values;
    
        print $loess->summary();
    
        my $prediction = $loess->predict($new_data, 1);
        my $confidence_intervals = $prediction->confidence(0.05);
        print $confidence_internals->{fit};
        print $confidence_internals->{upper};
        print $confidence_internals->{lower};

CONSTRUCTION

        new(Piddle1D :$x, Piddle1D :$y, Piddle1D :$weights=undef,
            Num :$span=0.75, Str :$family='gaussian')

    Arguments:

      * $x

      A PDL piddle for x data.

      In case of multiple predictors, $x is a glued piddle containing all
      predictors' data. It's possible to have at most 8 predictors.

      * $y

      A PDL piddle for y data.

      * $weights

      Optional weights.

      * $span

      POD INCLUDE ERROR: Can't load template 'span' from
      'Math::LOESS::Model'.

      When provided as a construction parameter, it is like a shortcut for,

          $loess->model->span($span);

      * $family

      POD INCLUDE ERROR: Can't load template 'family' from
      'Math::LOESS::Model'.

      When provided as a construction parameter, it is like a shortcut for,

          $loess->model->family($family);

NAME

    Math::LOESS - Perl wrapper of the Locally-Weighted Regression package
    originally written by Cleveland, et al.

ATTRIBUTES

 model

    Get an Math::LOESS::Model object.

 outputs

    Get an Math::LOESS::Outputs object.

 x

    Get input x data as a piddle.

 y

    Get input y data as a piddle.

 weights

    Get input weights data as a piddle.

 activated

    Returns a true value if the object's fit() method has been called.

METHODS

 fit

        fit()

 predict

        predict(Piddle1D $newdata, Bool $stderr=false)

    Returns a Math::LOESS::Prediction object.

 summary

        summary()

    Returns a summary string.

SEE ALSO

    https://en.wikipedia.org/wiki/Local_regression

    PDL

AUTHOR

    Stephan Loyd <sloyd@cpan.org>

COPYRIGHT AND LICENSE

    This software is copyright (c) 2019 by Stephan Loyd.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

