[R] C code for KalmnaLike

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Oct 13 10:59:38 CEST 2006


On Thu, 2006-10-12 at 10:57 -0400, Leeds, Mark (IED) wrote:
> you shouldn't need it. Kalmanlike() ( spelling ) I think is in the base
> package and there is atleast
> One constributed package and probably many others that do kalman
> filtering but I can't recall the names of them.
> 
> Check out the list of packages at www.r-project.org.
> 

Mark, That pre-supposes that Malini just wants to perform kalman
filtering, and not look at the inner workings of the implementation in
R. KalmanLike is in package stats distributed with base R, but it is
defined as:

> KalmanLike
function (y, mod, nit = 0, fast = TRUE)
{
    x <- .Call("KalmanLike", y, mod$Z, mod$a, mod$P, mod$T, mod$V,
        mod$h, mod$Pn, as.integer(nit), FALSE, fast = fast, PACKAGE = "stats")
    names(x) <- c("ssq", "sumlog")
    s2 <- x[1]/length(y)
    list(Lik = 0.5 * (log(x[1]/length(y)) + x[2]/length(y)),
        s2 = s2)
}
<environment: namespace:stats>

So, not much use in reading the R code as this just calls compiled code.
If Malini really does want to look at the C code for KalmanLike then Uwe
Ligges recently posted a preview of an article he is writing for R News,
which explains how to access various parts of R's source code. The
preview is still available from:

http://www.statistik.uni-dortmund.de/~ligges/R_Help_Desk_preview.pdf

The information contained in the article should allow Malini to find the
C for KalmanLike.

HTH,

G

> 
> 
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Malini
> Subramanian
> Sent: Thursday, October 12, 2006 9:56 AM
> To: R-help at stat.math.ethz.ch
> Subject: Re: [R] C code for KalmnaLike
> 
> hi,
>   i am looking for c code of kalman filtering please can you help
> me...thankyou bye...
> 
>  				
> ---------------------------------
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> --------------------------------------------------------
> 
> This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson                 [t] +44 (0)20 7679 0522
 ECRC & ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/cv/
 London, UK. WC1E 6BT.         [w] http://www.ucl.ac.uk/~ucfagls/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list