The Rmetrics "fRegression" package is a collection of functions for linear and non-linear regression modelling.
Regression modelling, especially linear modelling, LM, is a widely used application in financial engineering. In finance it mostly appears in form that a variable is modelled as a linear or more complex relationship as a function of other variables. For example the decision of buying or selling in a trading model may be triggered by the outcome of a regression model, e.g. neural networks are a well known tool in this field.
Rmetrics has build a unique interface to several regression
models available in the base and contributed packages of R.
The following regression models are interfaced and
available through a common function regFit
. The
argument use
allows to select the desired model:
regFit fits regression models
- lm fits a linear model [stats]
- rlm fits a LM by robust regression [MASS]
- glm fits a generliazed linear model [stats]
- gam fits a generlized additive model [mgcv]
- ppr fits a projection pursuit regression model [stats]
- nnet fits a single hidden-layer neural network model [nnet]
- polymars fits an adaptive polynomial spline regression [polspline]
An advantage of the regFit
function is, that all the
underlying functions of its family can be called with the same
list of arguments, and the value returned is always an unique
object, an object of class "fREG"
with the following slots:
@call
, @formula
, @method
, @data
,
@fit
, @residuals
, @fitted
, @title
,
and @description
.
Furthermore, independent of the selected regression model applied
we can use the same S4 methods for all types of regressions. This
includes, print
,plot
, summary
, predict
,
fitted
, residuals
, coef
, vcov
, and
formula
methods.
It is possible to add further regression models to this framework
either his own implementations or implementations available through
other contributed R packages. Suggestions include biglm
,
earth
amongst others.
contains a function to simulate artificial regression models, mostly used for testing.
regSim simulates artificial regression model data sets
These generic functions are:
fitted extracts fitted values from a fitted 'fREG' object
residuals extracts residuals from a fitted 'fREG' object
coef extracts coefficients from a fitted 'fREG' object
formula extracts formula expression from a fitted 'fREG' object
vcov extracts variance-covariance matrix of fitted parameters
The function predict
returns predicted values based on the
fitted model object.
predict forecasts from an object of class 'fREG'
For printing and plotting use the functions:
print prints the results from a regression fit
plot plots the results from a gression fit
summary returns a summary report
The fRegression
Rmetrics package is written for educational
support in teaching "Computational Finance and Financial Engineering"
and licensed under the GPL.
Package: | fRegression |
Type: | Package |
Version: | R 3.0.1 |
Date: | 2014 |
License: | GPL Version 2 or later |
Copyright: | (c) 1999-2014 Rmetrics Association |
Repository: | R-FORGE |
URL: | https://www.rmetrics.org |