EVOLUTION-MANAGER
Edit File: arima.sim.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Simulate from an ARIMA Model</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for arima.sim {stats}"><tr><td>arima.sim {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Simulate from an ARIMA Model</h2> <h3>Description</h3> <p>Simulate from an ARIMA model. </p> <h3>Usage</h3> <pre> arima.sim(model, n, rand.gen = rnorm, innov = rand.gen(n, ...), n.start = NA, start.innov = rand.gen(n.start, ...), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>model</code></td> <td> <p>A list with component <code>ar</code> and/or <code>ma</code> giving the AR and MA coefficients respectively. Optionally a component <code>order</code> can be used. An empty list gives an ARIMA(0, 0, 0) model, that is white noise.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>length of output series, before un-differencing. A strictly positive integer.</p> </td></tr> <tr valign="top"><td><code>rand.gen</code></td> <td> <p>optional: a function to generate the innovations.</p> </td></tr> <tr valign="top"><td><code>innov</code></td> <td> <p>an optional times series of innovations. If not provided, <code>rand.gen</code> is used.</p> </td></tr> <tr valign="top"><td><code>n.start</code></td> <td> <p>length of ‘burn-in’ period. If <code>NA</code>, the default, a reasonable value is computed.</p> </td></tr> <tr valign="top"><td><code>start.innov</code></td> <td> <p>an optional times series of innovations to be used for the burn-in period. If supplied there must be at least <code>n.start</code> values (and <code>n.start</code> is by default computed inside the function).</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional arguments for <code>rand.gen</code>. Most usefully, the standard deviation of the innovations generated by <code>rnorm</code> can be specified by <code>sd</code>.</p> </td></tr> </table> <h3>Details</h3> <p>See <code><a href="arima.html">arima</a></code> for the precise definition of an ARIMA model. </p> <p>The ARMA model is checked for stationarity. </p> <p>ARIMA models are specified via the <code>order</code> component of <code>model</code>, in the same way as for <code><a href="arima.html">arima</a></code>. Other aspects of the <code>order</code> component are ignored, but inconsistent specifications of the MA and AR orders are detected. The un-differencing assumes previous values of zero, and to remind the user of this, those values are returned. </p> <p>Random inputs for the ‘burn-in’ period are generated by calling <code>rand.gen</code>. </p> <h3>Value</h3> <p>A time-series object of class <code>"ts"</code>. </p> <h3>See Also</h3> <p><code><a href="arima.html">arima</a></code> </p> <h3>Examples</h3> <pre> require(graphics) arima.sim(n = 63, list(ar = c(0.8897, -0.4858), ma = c(-0.2279, 0.2488)), sd = sqrt(0.1796)) # mildly long-tailed arima.sim(n = 63, list(ar = c(0.8897, -0.4858), ma = c(-0.2279, 0.2488)), rand.gen = function(n, ...) sqrt(0.1796) * rt(n, df = 5)) # An ARIMA simulation ts.sim <- arima.sim(list(order = c(1,1,0), ar = 0.7), n = 200) ts.plot(ts.sim) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>