Displaying 2 results from an estimated 2 matches for "maskmatrix".
2010 Sep 22
1
Newey West and Singular Matrix
...ot particularly good. see, we could zero out also
## items which are multiplications with a missing residual for example,
## if we do an ar1 correction, and obs 5 is missing, then the AR term on
## 4 and 6 could be set to 0. right now, we just adjust for an add'l
## term.
maskmatrix <- diagband.matrix( length(r.na.omitted), ar.terms )
resid.matrix <- full * maskmatrix
}
invx.x <- invx %*% t(x.na.omitted)
vmat <- invx.x %*% resid.matrix %*% t(invx.x)
sqrt(diag(vmat))
}
2010 Sep 23
1
Newey West and Singular Matrix + library(sandwich)
...ut also
>> ? ## items which are multiplications with a missing residual for example,
>> ? ## if we do an ar1 correction, and obs 5 is missing, then the AR term on
>> ? ## 4 and 6 could be set to 0. ?right now, we just adjust for an add'l
>> ? ## term.
>>
>> ? maskmatrix <- diagband.matrix( length(r.na.omitted), ar.terms )
>> ? resid.matrix <- full * maskmatrix
>> ?}
>>
>> ?invx.x <- invx %*% t(x.na.omitted)
>> ?vmat <- ?invx.x %*% resid.matrix %*% t(invx.x)
>> ?sqrt(diag(vmat))
>> }
>>
>> __________...