Re: [R] C code for KalmnaLike

From: Leeds, Mark (IED) <Mark.Leeds_at_morganstanley.com>
Date: Fri 13 Oct 2006 - 13:24:53 GMT


Gavin, you are right. I thought he just wanted a routine. My bad.

-----Original Message-----
From: Gavin Simpson [mailto:gavin.simpson@ucl.ac.uk] Sent: Friday, October 13, 2006 5:00 AM
To: Leeds, Mark (IED)
Cc: Malini Subramanian; R-help@stat.math.ethz.ch Subject: Re: [R] C code for KalmnaLike

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@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Malini
> Subramanian
> Sent: Thursday, October 12, 2006 9:56 AM
> To: R-help@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@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@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/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
--------------------------------------------------------

This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}

______________________________________________
R-help@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.
Received on Sat Oct 14 13:45:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 14 Oct 2006 - 04:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.