Giter VIP home page Giter VIP logo

midasr-user-guide's People

Contributors

vzemlys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

midasr-user-guide's Issues

variable lengths differ (found for 'trend') Any solution to my Problem below

Hello , i need urgent solution on the following. Having read the midas JSS article, i improve my question . I realise if i add

for(i in ((length(FinQ)+1):length(Mvs)))+ { FinQ = c(FinQ, 0)} before

Simulated low-frequency series (e.g. yearly)

the code runs and produce a graph of weights against high frequency lags which could not be produced before hoping i have done the right thing.

library(midasr)
set.seed(4)

Number of low-frequency observations

n<-146

Linear trend and higher-frequency explanatory variables (e.g. quarterly and monthly)

trend<-c(1:n)
Gdp <-ts(Gdp, start = c(1997, 1), frequency = 4)
Mvs <- ts(Ftwn, start = c(1997, 1), frequency = 12)
FinQ <- ts(FQrt[,-10], start = c(1997, 1), frequency = 4)

Exponential Almon polynomial constraint-consistent coefficients

fn.FinQ<- nealmon(p=c(1,-0.5),d=9)
fn.Mvs <- nealmon(p=c(2,0.5,-1),d=9)
for(i in ((length(FinQ)+1):length(Mvs)))+ { FinQ = c(FinQ, 0)}

Simulated low-frequency series (e.g. yearly)

Gdp<-2+0.1trend + mls(FinQ,2,3)%%fn.FinQ + mls(Mvs,2,3)%*%fn.Mvs + rnorm(n)

When i then try to run the below code, i am getting error which is below, anyone who can help here. I have tried all sorts of lag structure for mls(Gdp,..,2 nealmon) but can't manage to get it right to escape the error, what m i am doing wrong or how can i correct the issue here , thanks .

Gdp<- na.omit(Gdp)
EQ <- midas_r(Gdp ~ trend + mls(FinQ,3,2, nealmon) + mls(Mvs,7:12,8, nealmon), start=list(Gdp=c(10,1,-0.1),Mvs=c(2,-0.1)))

Error in model.frame.default(formula = Gdp ~ trend + mls(FinQ, 3, 2, nealmon) + : variable lengths differ (found for 'trend')

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.