search for: pnew

Displaying 3 results from an estimated 3 matches for "pnew".

Did you mean: new
2008 Mar 16
2
(no subject)
...om(n, p) s <- sum(x) f <- function(x, p) p*(1-p)^x L <- function(p) p^n*(1-p)^s logL <- function(p) n*log(p)+s*(log(1-p)) logLprime <- function(p) (n/p)-(s/(1-p)) I <- n/p^2*(1-p) iter <- 10 p[1] <- .06 p[2] <- .11 for (i in 1:10) { pnew <- p[i]+logLprime(p[i])/I*(p[i]) } [[alternative HTML version deleted]]
2005 Nov 30
0
unexpected result from KalmanRun (KalmanLike, StructTS)
...v, P[t+1] = 0 (also equivalent to exponential moving average, Durbin/Koopman p49) So I am getting a serious discrepancy between manual and KalmanRun computations. To make things more interesting, looking into the code of arima.c we have at line 109 an equivalent of a[t+1] = anew + Pnew * resid0 / gain where gain = mod$h = H (by line 97), resid0 = y-a = v (by lines 94-96) Since Pnew = 0, then a[t+1] = a, which explains why the computation returns res$states = c(1,1,1,1,1). The help file says "'states', the contemporaneous state estimates", which I as...
2005 Jun 15
1
Kalman Filtering?
1. The function "KalmanLike" seems to change its inputs AND PREVIOUSLY MADE copies of the inputs. Consider the following (using R 2.1.0 patched under Windows XP): > Fig2.1 <- StructTS(x=Nile, type="level") > unlist(Fig2.1$model0[2:3]) a P 1120 286379470 > tst2 <- tst <- Fig2.1$model0 > tst23 <- tst[2:3] > tst23u <-