helske / KFAS

KFAS: R Package for Exponential Family State Space Models
64 stars 17 forks source link

Weighted regression #38

Closed sschloss1 closed 5 years ago

sschloss1 commented 5 years ago

I'm wondering if it's possible in SSMregression() to do weighted regression so that the observations are weighted via a vector or matrix of weights. My model is a binomial model if that makes a difference

Also, thanks for the package! This has helped me tackle a very messy state-space model.

sschloss1 commented 5 years ago

I figured out a workaround, so I'm going to close this.

helske commented 5 years ago

Sorry I missed this one. Can you share your workaround idea for future reference? I have not though about weighted regression for KFAS but I have a feeling it should be doable somehow (and apparently it is?).

sschloss1 commented 5 years ago

Perhaps "workaround" was the wrong term, since what I did really isn't the equivalent. I had a multivariate time series, and when I tested independent error terms for each time series in the Q matrix vs an unstructured covariance matrix, the independent model was strongly supported. So I just ran the independent models and then took weighted sums of the predicted state values.