# 2307 search results for "time series"

## Quantitative Finance Applications in R – 3: Plotting xts Time Series

January 28, 2014
By

by Daniel Hanson, QA Data Scientist, Revolution Analytics Introduction and Data Setup Last time, we included a couple of examples of plotting a single xts time series using the plot(.) function (ie, said function included in the xts package). Today, we’ll look at some quick and easy methods for plotting overlays of multiple xts time series in a single...

## Causal Autoregressive Time Series

January 21, 2014
By
$AR(1)$

In the MAT8181 graduate course on Time Series, we will discuss (almost) only causal models. For instance, with , with some white noise , those models are obtained when . In that case, we’ve seen that was actually the innovation process, and we can write which is actually a mean-square convergent series (using simple Analysis arguments on series). From that...

## Visualizing Autoregressive Time Series

January 21, 2014
By
$AR(1)$

In the MAT8181 graduate course on Time Series, we started discussing autoregressive models. Just to illustrate, here is some code to plot  – causal – process, > graphar1=function(phi){ + nf <- layout(matrix(c(1,1,1,1,2,3,4,5), 2, 4, byrow=TRUE), respect=TRUE) + e=rnorm(n) + X=rep(0,n) + for(t in 2:n) X=phi*X+e + plot(X,type="l",ylab="") + abline(h=mean(X),lwd=2,col="red") + abline(h=mean(X)+2*sd(X),lty=2,col="red") + abline(h=mean(X)-2*sd(X),lty=2,col="red") + u=seq(-1,1,by=.001) + plot(0:1,0:1,col="white",xlab="",ylab="",axes=FALSE,ylim=c(-2,2),xlim=c(-2.5,2.5)) + polygon(c(u,rev(u)),c(sqrt(1-u^2),rev(-sqrt(1-u^2))),col="light yellow")...

## Estimating a nonlinear time series model in R

January 20, 2014
By

There are quite a few R packages available for nonlinear time series analysis, but sometimes you need to code your own models. Here is a simple example to show how it can be done. The model is a first order threshold autoregression:     where is a Gaussian white noise series with variance . The following function will generate...

## Detecting a Time Series Change Point

January 4, 2014
By

In this example we will detect the change point in a time series of counts using Bayesian methodology. A natural solution to this problem utilizes a Gibbs sampler. We’ll first implement the sampler in R naively, then create a vectorized R implementation, and lastly create an implementation of the sampler using Rcpp and RcppArmadillo. We will compare these implementations...

## Spurious Regression of Time Series

December 30, 2013
By

## Local Council Spending Data – Time Series Charts

November 6, 2013
By

In What Role, If Any, Does Spending Data Have to Play in Local Council Budget Consultations? I started wondering about the extent to which local spending transparency data might play a role in supporting consultation around new budgets. As a first pass, I’ve popped up a quick application up at http://glimmer.rstudio.com/psychemedia/iwspend2013_14/ (shiny code here). You

## Time series plots in R

October 23, 2013
By

I recently coauthored a couple of papers on trends in environmental data (Curtis & Simpson in press; Monteith et al. in press), which we estimated using GAMs. Both papers included plots like the one shown below wherein we show the estimated trend and associated point-wise 95% confidence interval, plus some other markings. The coloured sections show...

## Time Series Decomposition

August 12, 2013
By

In the last post on the changepoint package, I concluded with a brief example of time series decomposition with the "decompose" command.  After further reading, I discovered the "stl" command, which to me appears a superior method.  STL stand...

## Changepoint Analysis of Time Series?

August 4, 2013
By

Last time we downloaded data from quandl.com.  This was privately-owned homes completed in a month in thousands of units(not seasonally adjusted).  Now, let's take a look at some basic R functions to examine time series along with my first ex...

## Recent popular posts

Contact us if you wish to help support R-bloggers, and place your banner here.

# Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts.(You will not see this message again.)

Click here to close (This popup will not appear again)