giovanni's dlm book is also very nice for learning the dlm package. the dlm notation is along the notation of west and harrison . the package to use can often be linked to where one learned about the kalman filter so that can sometimes guide your package decison.<br /><br /><br /><br /><br /><br /><p>On Dec 5, 2009, <strong>Gabor Grothendieck</strong> <ggrothendieck@gmail.com> wrote: </p><div class="replyBody"><blockquote style="border-left: 2px solid #267fdb; margin: 0pt 0pt 0pt 1.8ex; padding-left: 1ex">If you just need R examples then there is a paper on the jstatsoft site that<br />has R examples of Kalman filtering with sspir. Try google.<br /><br />On Sat, Dec 5, 2009 at 8:58 AM, Hubert Colt <<a href="mailto:hubert.colt@gmail.com" target="_blank" class="parsedEmail">hubert.colt@gmail.com</a>> wrote:<br /><br />> Hi,<br />><br />> My apologies in advance if my question seems somewhat basic. I am for the<br />> first time in need of using a Kalman filter in R, but am unsure as to which<br />> of the available packages I should choose. There seems to be a lot of<br />> different ones to chose from, from the regular KalmanLike and -Run from the<br />> base package, to the Kalman filter in the dlm package, the filters from ***<br />> ssall.R*<<br />> <a href="https://owa.nhh.no/exchweb/bin/redir.asp?URL=http://www.stat.pitt.edu/stoffer/tsa2/Rcode/New6/ssall.R" target="_blank" class="parsedLink">https://owa.nhh.no/exchweb/bin/redir.asp?URL=http://www.stat.pitt.edu/stoffer/tsa2/Rcode/New6/ssall.R</a><br />> ><br />> . used by Schumway and Stoffer and the KFAS package by Jouni Lehtonen (***<br />> <a href="https://stat.ethz.ch/pipermail/r-packages/2009/001049.html*" target="_blank" class="parsedLink">https://stat.ethz.ch/pipermail/r-packages/2009/001049.html*</a><<br />> <a href="https://owa.nhh.no/exchweb/bin/redir.asp?URL=https://stat.ethz.ch/pipermail/r-packages/2009/001049.html" target="_blank" class="parsedLink">https://owa.nhh.no/exchweb/bin/redir.asp?URL=https://stat.ethz.ch/pipermail/r-packages/2009/001049.html</a><br />> ><br />> ).<br />><br />> The time series I wish to use the filter on are time invariant, with<br />> observations every month, and have no missing data. I am trying to judge<br />> whether one portfolio of stocks outperforms another, and hope to utilize<br />> the<br />> Kalman Filter in order to reduce the noise in the sample.<br />><br />> I have reason to believe the equation explaining returns looks like this:<br />><br />><br />> Yt = įt + Ä1t * MRKTPREMt + Ä2t * SMBt + Ä3t * HMLt + Ä4t * MOMt<br />><br />> Where Yt is the excess return of portfolio 1 (portfolio1-portfolio2) in<br />> month t, SMB and HML are the Fama French Factors, MOM is momentum and<br />> MRKTPREM is the market premium. I have time series detailing all of these,<br />> but have reason to believe that the loadings and alpha vary over time.<br />><br />> First and foremost I would like to obtain a maximum likelihood row of time<br />> variable alphas, with the other loadings fixed, in order to surmise if they<br />> are jointly positive. However, If the model allows it, I would like to<br />> introduce the possibility of non-fixed betas as well.<br />><br />> I have ordered Schumway and Stoffer's book, but due to the time constraints<br />> of<br />> my research I would be very thankful if one of you could help point me in<br />> the right direction. If anyone knows any easy to use non-R software that<br />> could do the operation, I would be glad to hear from you too.<br />><br />> I am using R 2.10 and my OS is Windows Vista, in case that has any impact.<br />><br />> Thank you in advance for taking time out of your day to answer me.<br />><br />> -Hubert<br />><br />> [[alternative HTML version deleted]]<br />><br />><br />> _______________________________________________<br />> <a href="mailto:R-SIG-Finance@stat.math.ethz.ch" target="_blank" class="parsedEmail">R-SIG-Finance@stat.math.ethz.ch</a> mailing list<br />> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank" class="parsedLink">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br />> -- Subscriber-posting only.<br />> -- If you want to post, subscribe first.<br />><br /><br />        [[alternative HTML version deleted]]<br /><br /><br /><hr /><br />_______________________________________________<br /><a href="mailto:R-SIG-Finance@stat.math.ethz.ch" target="_blank" class="parsedEmail">R-SIG-Finance@stat.math.ethz.ch</a> mailing list<br /><a href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank" class="parsedLink">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br />-- Subscriber-posting only.<br />-- If you want to post, subscribe first.</blockquote></div>