mbalcilar / mfilter Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous Time Series Filters: Christiano-Fitzgerald, Baxter-King, Hodrick-Prescott, Butterworth, and trigonometric regression filters
Miscellaneous Time Series Filters: Christiano-Fitzgerald, Baxter-King, Hodrick-Prescott, Butterworth, and trigonometric regression filters
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
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] = piR0
for(i in 2:n)
{
dj = Bge(i-2,nq,B,cc)
R[i] = R[i-1] - dj
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.