1646 search results for "time series"

Inference for MA(q) Time Series

January 29, 2014
By
Inference for MA(q) Time Series

Yesterday, we’ve seen how inference for time series was possible.  I started  with that one because it is actually the simple case. For instance, we can use ordinary least squares. There might be some possible bias (see e.g. White (1961)), but asymptotically, estimators are fine (consistent, with asymptotic normality). But when the noise is (auto)correlated, then it is more...

Read more »

Inference for AR(p) Time Series

January 28, 2014
By
Inference for AR(p) Time Series

Consider a (stationary) autoregressive process, say of order 2, for some white noise with variance . Here is a code to generate such a process, > phi1=.25 > phi2=.7 > n=1000 > set.seed(1) > e=rnorm(n) > Z=rep(0,n) > for(t in 3:n) Z=phi1*Z+phi2*Z+e > Z=Z > n=length(Z) > plot(Z,type="l") Here, we have to estimate two sets of parameters: the autoregressive...

Read more »

Time series data in R

January 28, 2014
By

There is no shortage of time series data available on the web for use in student projects, or self-learning, or to test out new forecasting algorithms. It is now relatively easy to access these data sets directly in R. M Competition data The 1001 series from the M-competition and the 3003 series from the M3-competition are available as part...

Read more »

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

January 28, 2014
By
Quantitative Finance Applications in R – 3: Plotting xts Time Series

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...

Read more »

Causal Autoregressive Time Series

January 21, 2014
By
Causal Autoregressive Time Series

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...

Read more »

Visualizing Autoregressive Time Series

January 21, 2014
By
Visualizing Autoregressive Time Series

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")...

Read more »

Estimating a nonlinear time series model in R

January 20, 2014
By
Estimating a nonlinear time series model in R

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...

Read more »

Detecting a Time Series Change Point

January 4, 2014
By
Detecting a Time Series Change Point

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...

Read more »

Spurious Regression of Time Series

December 30, 2013
By
Spurious Regression of Time Series

spu.ri.ousadjective : not...

Read more »

Local Council Spending Data – Time Series Charts

November 6, 2013
By
Local Council Spending Data – Time Series Charts

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

Read more »