Giter Site home page Giter Site logo

Comments (6)

vzemlys avatar vzemlys commented on May 9, 2024

Current behaviour is exactly like lm. In the data argument you pass the data where named columns correspond to variables, and the construction of the model is governed by formula interface. So for your example the specification would be

 midas_r(rGDPg2~fmls(MonMulti,ratio-1, ratio, nealmon),data=midasdata,start=list(MonMulti=c(1,-0.1)))

where

  midasdata <- list(rGDPg2=y,MonMulti=x)

If rGDPg2 and MonMulti are in Global environment, then there is no need to specify the data argument, the behaviour which is consistent with lm.

I do not see the benefits of your proposal and I immediately see several problems related to the implementation. For example how would I know that nealmon restriction should be used? Maybe I misunderstand something, could you elaborate more on your proposal, or specifically what problems do you see with the current implementation?

from midasr.

MaximilianJHuber avatar MaximilianJHuber commented on May 9, 2024

My point is that the formula gets excessively large when there are more variables, so I think it would increase readability and formula flexibility (i.e. if a formula is constructed on-the-fly) to prepare a list of mls matrices first. Then the formula's job is only to specify my model, not to prepare data.

from midasr.

vzemlys avatar vzemlys commented on May 9, 2024

There is still a question of how the restriction would be defined in such case. All of the potential restrictions use the same mls matrix. It would be possible to implement this using the attributes, but I do not see how this would improve the clarity. Yes the formula would be smaller, but

  • a user would not see what restriction is used in the model definition
  • if a user wants to change the restriction, then he/she will need to update the matrix, instead of the formula
  • user would be required to track the alignment of the matrices, i.e. that their dimensions match. This includes caring about NA values, etc. Currently this is automatically handled by the formula interface, you only need to make sure that your mixed frequency data is aligned, which is much more natural to do for the original data, not for its transformations.
  • formula interface allows to specify transformations of the variables. For example taking logarithm of the variable. To make it happen with your proposed format, I would need to reimplement the way R formula works.

from midasr.

MaximilianJHuber avatar MaximilianJHuber commented on May 9, 2024

Ok, your last point is the most striking one. The mls is just a transformation of data as the log, etc. is and belongs in the formula.
Thank you for your time, you are doing a great job with midasr!

from midasr.

vzemlys avatar vzemlys commented on May 9, 2024

You are welcome.

from midasr.

vzemlys avatar vzemlys commented on May 9, 2024

Now you can also use function midas_r_simple. This function does not use formula interface and expects matrices prepared with mls. This function is currently available in development version of midasr, which you can install using install_("midasr","mpiktas","np"). See the example in ?midas_r_simple.

from midasr.

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.