Giter VIP home page Giter VIP logo

mfilter's People

Contributors

mbalcilar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mfilter's Issues

package crashes on R 4.1.2

Hi,
Thanks for making this package available.
I've been using the package for a while. Lately on updated machines the package crashes with a very simple example, depending on the length of the series. Being a hard crash of R I can't get details. But it appears a problem of memory access. Maybe some of the installation flags conflict with other libraries I have on my computer... hard to tell.

Any clue?

Cheers
Gianni

This is the example. Below the details of my R installation

fr_=12 tmp25<-as.ts(rnorm(170)) lmb<-1600 *(fr_/4)^4 # Ravn and Uhlig 2002 out<-mFilter::mFilter( tmp25 ,filter='HP',lambda=lmb,na.rm=T) out<-bHP::BoostedHP(tmp25,lambda = lmb,iter = T)

R installation
platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 4 minor 1.2 year 2021 month 11 day 01 svn rev 81115 language R version.string R version 4.1.2 (2021-11-01) nickname Bird Hippie

Error when using theta vector longer than 2 in the cffilter

Hi @mbalcilar
I got an error running cffilter() with a theta vector of size 3 or longer.
From my understanding nq equals the length of the theta vector minus one, so in my case nq = 2

But in the code below, R0 issues an warning. B[1]*cc[1] is a scalar. But both B[2:3] and cc[2:3] are vectors. They are multiplied element by element producing another vector. Transpose does not change anything since it is a one dimensional vector. As a result, R0 is a vector of dimension 2 or higher. However, it is then assigned to R[1] which expects a scalar -- and therefore R issues a warning message.

I am not familiar with the details of the filter implementation, so I am not able to understand what the
2*t(B[2:(nq+1)])*cc[2:(nq+1)] part is supposed to do.

Can you help me with that ?

Thanks and congrats for the very useful package !

if(nq > 0)
{
R0 = B[1]cc[1] + 2t(B[2:(nq+1)])cc[2:(nq+1)]
R[1] = pi
R0
for(i in 2:n)
{
dj = Bge(i-2,nq,B,cc)
R[i] = R[i-1] - dj
}
}

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.