Giter Site home page Giter Site logo

yjiangnan / pyloess Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcrotinger/pyloess

1.0 1.0 1.0 688 KB

loess smoother / stl seasonal trend decomposition, originally from scipy.sandbox.pyloess

License: MIT License

Python 56.01% Batchfile 0.01% Shell 0.01% C 10.31% C++ 0.15% Fortran 33.52%

pyloess's People

Stargazers

 avatar

Forkers

zachgarner

pyloess's Issues

pyloess does not work properly for X with more than one dimensions

Currently, pyloess only works for fitting vectors x vs. y. It does not work properly for Matrix X with more than 1 dimensions vs. vector y. To reproduce the problem,

from numpy import *
from pyloess import loess
x = random.randn(403, 2)
y = sum(x, axis=1) + sum(random.randn(403, 2)/2, axis=1)
lo = loess(x, y)
lo.fit()
yfit = lo.outputs.fitted_values.tolist()
from mpl_toolkits.mplot3d import Axes3D
from pylab import *
fig = figure()
ion()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(x[:,0], x[:,1], y)
ax.scatter(x[:,0], x[:,1], yfit, 'r')
show()

One can clearly see that the data points of y increase with the sum of x[:,0] and x[:,1], but yfit seems to be almost unaffected by the change of x. The problem seems to lie in file loessf.f in regarding to how the data is fitted (e.g. subroutine ehg127), but the Fortran code proved extremely difficult for me to understand or debug.

Not sure if someone can fix this ancient code or completely re-implement it in C/C++. It would be usefully if we can fit a dependent variable to more than one independent variables. The implementation should also correctly calculate the standard error of the fitting, since it is important in library rosely for biomedical research.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.