search for: lastval

Displaying 4 results from an estimated 4 matches for "lastval".

Did you mean: last_val
2017 Jul 30
4
Kalman filter for a time series
...x ) { t = x if (class(t) != "ts") { t = ts(t) } ssModel = structSSM( y = t, distribution="Gaussian") ssFit = fitSSM(inits=c(0.5*log(var(t)), 0.5*log(var(t))), model = ssModel ) kfs = KFS( ssFit$model, smoothing="state", nsim=length(t)) vals = kfs$a lastVal = vals[ length(vals)] return(lastVal) } Start = "2011-01-01" End = "2012-12-31" SandP = "^GSPC" windowWidth = 20 tsLength = 100 SAndP.ts = getDailyPrices( SandP, Start, End ) SAndP.ts = SAndP.ts[1:tsLength] SAndP.smoothed = rollapply( data=SAndP.ts, width=window...
2017 Jul 30
0
Kalman filter for a time series
...) != "ts") { > t = ts(t) > } > ssModel = structSSM( y = t, distribution="Gaussian") > ssFit = fitSSM(inits=c(0.5*log(var(t)), 0.5*log(var(t))), model = ssModel ) > kfs = KFS( ssFit$model, smoothing="state", nsim=length(t)) > vals = kfs$a > lastVal = vals[ length(vals)] > return(lastVal) > } > > Start = "2011-01-01" > End = "2012-12-31" > SandP = "^GSPC" > > windowWidth = 20 > tsLength = 100 > > SAndP.ts = getDailyPrices( SandP, Start, End ) > SAndP.ts = SAndP.ts[1:tsLeng...
2017 Jul 30
0
Kalman filter for a time series
...quot;) { > t = ts(t) > } > ssModel = structSSM( y = t, distribution="Gaussian") > ssFit = fitSSM(inits=c(0.5*log(var(t)), 0.5*log(var(t))), model = ssModel ) > kfs = KFS( ssFit$model, smoothing="state", nsim=length(t)) > vals = kfs$a > lastVal = vals[ length(vals)] > return(lastVal) > } > > Start = "2011-01-01" > End = "2012-12-31" > SandP = "^GSPC" > > windowWidth = 20 > tsLength = 100 > > SAndP.ts = getDailyPrices( SandP, Start, End ) > SAndP.ts = SAndP.ts[1:tsLengt...
2005 Jun 04
2
locator() via tcltk
Hello, I'm trying to write a function using tcltk to interactively modify a plot and gather locator() data. I've read Peter's articles in Rnews, the help pages in tcltk, http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/, plus a post in R-help sometime ago, but haven't found a solution. The idea goes something like this: require(tcltk) testplot <- function() { getcoords