Displaying 1 result from an estimated 1 matches for "tvnairu".
2011 Jun 07
2
Setting up a State Space Model in dlm
..."UNRATE",src="FRED") ## Unemployment rate
getSymbols("GDPDEF",src="FRED") ## Quarterly GDP Implicit Price Deflator
u <- aggregate(UNRATE,as.yearqtr,mean)
gdpdef <- aggregate(GDPDEF,as.yearqtr,mean)
pi <- diff(log(gdpdef))*400
pilag <- lag(pi,-1)
tvnairu <- cbind(pi,pilag,u)
tvnairu.df <- subset(data.frame(tvnairu), !is.na(pi) & !is.na(u) &
!is.na(pilag))
## First attempt
buildNAIRU <- function(x) {
modNAIRU <- dlm(FF=t(matrix(c(1,1,1,0))),
GG=diag(4),
W=matrix(c(0,0,0,0, 0,0,0,0, 0,0,0....