EVOLUTION-MANAGER
Edit File: buildModel.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: Build quantmod model given specified fitting method</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 buildModel {quantmod}"><tr><td>buildModel {quantmod}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Build quantmod model given specified fitting method </h2> <h3>Description</h3> <p>Construct and attach a fitted model of type <code>method</code> to <code>quantmod</code> object. </p> <h3>Usage</h3> <pre> buildModel(x, method, training.per, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> An object of class <code>quantmod</code> created with <code><a href="specifyModel.html">specifyModel</a></code> or an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> formula </p> </td></tr> <tr valign="top"><td><code>training.per</code></td> <td> <p> character vector representing dates in ISO 8601 format “CCYY-MM-DD” or “CCYY-MM-DD HH:MM:SS” of length 2</p> </td></tr> <tr valign="top"><td><code>method</code></td> <td> <p> A character string naming the fitting method. See details section for available methods, and how to create new methods.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p> Additional arguments to method call </p> </td></tr> </table> <h3>Details</h3> <p>Currently available methods include: </p> <p>lm, glm, loess, step, ppr, rpart[rpart], tree[tree], randomForest[randomForest], mars[mda], polymars[polspline], lars[lars], rq[quantreg], lqs[MASS], rlm[MASS], svm[e1071], and nnet[nnet]. </p> <p>The <code>training.per</code> <em>should</em> match the undelying date format of the time-series data used in modelling. Any other style may not return what you expect. </p> <p>Additional methods wrappers can be created to allow for modelling using custom functions. The only requirements are for a wrapper function to be constructed taking parameters <code>quantmod</code>, <code>training.data</code>, and .... The function must return the fitted model object and have a predict method available. It is possible to add predict methods if non exist by adding an S3 method for predictModel. The <code> buildModel.skeleton</code> function can be used for new methods. </p> <h3>Value</h3> <p>An object of class <code>quantmod</code> with fitted model attached </p> <h3>Note</h3> <p> See <code>buildModel.skeleton</code> for information on adding additional methods </p> <h3>Author(s)</h3> <p> Jeffrey Ryan </p> <h3>See Also</h3> <p><code><a href="specifyModel.html">specifyModel</a></code> <code><a href="tradeModel.html">tradeModel</a></code> </p> <h3>Examples</h3> <pre> ## Not run: getSymbols('QQQQ',src='yahoo') q.model = specifyModel(Next(OpCl(QQQQ)) ~ Lag(OpHi(QQQQ),0:3)) buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30')) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>quantmod</em> version 0.4.20 <a href="00Index.html">Index</a>]</div> </body></html>