Git Product home page Git Product logo

Comments (3)

mikekeith52 avatar mikekeith52 commented on May 21, 2024

If you have missing values in the data, it is most likely a statsmodels native issue: statsmodels/statsmodels#3534

Just in case, I will change how the freq argument is specified in the vecm model to see if that fixes the issue and that will be implemented in 0.14.4, planned for implementation on 9/23/22.

from scalecast.

mikekeith52 avatar mikekeith52 commented on May 21, 2024

Please test the model from 0.14.4 to see if you have the same issue. Thanks, as always, for raising the issue!

from scalecast.

mikekeith52 avatar mikekeith52 commented on May 21, 2024

I happened to run an example recently where I was able to reproduce this error. I'm seeing that it is most likely from using business-day data. Sometimes business days from various data sources don't line up with the business day definition used by pandas. To fix that, you can use df = df.asfreq('B', method='ffill'). Replace 'ffill' with the na-fill method of your choice in case nulls are introduced in this process. Make sure the dataframe's index is the datetime column. Here is an example where this would work:

import pandas_datareader as pdr
from scalecast.Forecaster import Forecaster
from scalecast.MVForecaster import MVForecaster

FANG = [
    'META',
    'AMZN',
    'NFLX',
    'GOOG',
]

fs = []
for sym in FANG:
    df = pdr.get_data_yahoo(sym)
    df = df.asfreq('B', method='ffill') # fixes the issue
    f = Forecaster(
        y=df['Close'],
        current_dates = df.index,
        future_dates = 65,
        end = '2022-09-30',
    )
    fs.append(f)
    
mvf = MVForecaster(*fs,names=FANG)

I think this is something that users will have to do in pandas before loading to a scalecast object, as I don't know how this could be implemented into the package.

from scalecast.

Related Issues (20)

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.