Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChadFulton/a9172cd6f41947333f47bd4842832619 to your computer and use it in GitHub Desktop.
Save ChadFulton/a9172cd6f41947333f47bd4842832619 to your computer and use it in GitHub Desktop.
Large dynamic factor models, forecasting, and nowcasting in Statsmodels
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeaniek
Copy link

jeaniek commented Apr 4, 2024

Hi,
Thank you very much for sharing your work. I wonder if the DynamicFactorMQ can also work with the mixed frequency data between yearly and quarterly? And more importantly, if this package can also work with panel data (i.e. multiple countries with data observed across years). Many thanks again!

@lladamartin
Copy link

Hi,
Thank you very much for your work. I wonder how DynamicFactorMQ deals with missing data when you have non-synchronized release indexes. I couldn't find documentation about this issue. Could you please tell me a little more about this?

@ChadFulton
Copy link
Author

Hi @jeaniek, yes, you could use DynamicFactorMQ with quarterly / annual data, and with multiple countries and multiple years. NOte that the package does not do anything special in those cases; it would just be a typical dynamic factor model.

@ChadFulton
Copy link
Author

Hi @lladamartin, I'm not sure I understand exactly what you're asking. Generally, the model allows for arbitrary patterns of missing observations. For example, if you data through 2024Q1 for one dataset, while another dataset has only been released through 2023Q4, then you would have a NaN value for the second dataset for 2024Q1. The model would run just fine in this case.

@lladamartin
Copy link

Thank you for your response. I apologize for the lack of clarity in my question. I have monthly information on a set of indicators. These indicators have 1, 2, and up to 3 months of lag. I want to obtain the latent factor of this information set. How does the model estimate the value of the factor in April if many indicators have missing data for that month and previous months? How does the model handle those missing values?

@ChadFulton
Copy link
Author

Because it is a state space model, where the unobserved state has a defined transition equation, it can produce an estimate for the factor in April even if you had no data for the month (i.e. it just estimates April using its estimate for March combined with the definition of how the state transitions between periods). As you start to observe parts of the data for April, it updates its estimate using whatever data is available. A more detailed description of how this works can be found in, e.g., Maximum likelihood estimation of factor models on datasets with arbitrary pattern of missing data

@lladamartin
Copy link

I'll see the paper! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment