buildModel             package:quantmod             R Documentation

_B_u_i_l_d _q_u_a_n_t_m_o_d _m_o_d_e_l _g_i_v_e_n _s_p_e_c_i_f_i_e_d _f_i_t_t_i_n_g _m_e_t_h_o_d

_D_e_s_c_r_i_p_t_i_o_n:

     Construct and attach a fitted model of type 'method' to 'quantmod'
     object.

_U_s_a_g_e:

     buildModel(x, training.per, method, ...)

_A_r_g_u_m_e_n_t_s:

       x: An object of class 'quantmod' created with 'specifyModel' or
          an R formula 

training.per: character vector representing dates in ISO 8601 format of
          length 2, e.g. c('1992-01-01','1992-04-01')

  method: A character string naming the fitting method. See details
          section for available methods, and  how to create new
          methods.

     ...: Additional arguments to method call 

_D_e_t_a_i_l_s:

     Currently available methods include:

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

     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 'quantmod', 
     'training.data', 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 ' buildModel.skeleton' function can be used for
     new methods.

_V_a_l_u_e:

     An object of class 'quantmod' with fitted model attached

_N_o_t_e:

     See 'buildModel.skeleton' for information on adding additional
     methods

_A_u_t_h_o_r(_s):

     Jeffrey Ryan

_S_e_e _A_l_s_o:

     'specifyModel' 'tradeModel'

_E_x_a_m_p_l_e_s:

     ## 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)

