MyNixOS website logo
Description

Rmetrics - Regression Based Decision and Prediction.

A collection of functions for linear and non-linear regression modelling. It implements a wrapper for several regression models available in the base and contributed packages of R.

fRegression

AppVeyor BuildStatus R-CMD-check CoverageStatus CRAN_Status_Badge Downloads(monthly) Downloads(total)

Rmetrics - Modelling Extreme Events in Finance

The fRegression package is a collection of functions for linear and non-linear regression modelling. It implements a wrapper for several regression models available in the base and contributed packages of R.

An example

The following code simulates some regression data and fits various models to these data.

library(fRegression)
# Simulate data: the response is linearly related to 3 explanatory variables 
x <- regSim(model = "LM3", n = 100)
  
# Linear modelling       
regFit(Y ~ X1 + X2 + X3, data = x, use = "lm") 
#> 
#> Title:
#>  Linear Regression Modeling 
#> 
#> Formula:
#>  Y ~ X1 + X2 + X3
#> 
#> Family:
#>  gaussian identity 
#> 
#> Model Parameters:
#> (Intercept)           X1           X2           X3  
#>     0.01578      0.73967      0.25128     -0.50611

# Robust linear modelling    
regFit(Y ~ X1 + X2 + X3, data = x, use = "rlm") 
#> 
#> Title:
#>  Robust Linear Regression Modeling 
#> 
#> Formula:
#>  Y ~ X1 + X2 + X3
#> 
#> Family:
#>  gaussian identity 
#> 
#> Model Parameters:
#> (Intercept)           X1           X2           X3  
#>     0.01968      0.74264      0.24736     -0.50123

# Generalised additive modelling       
regFit(Y ~ X1 + X2 + X3, data = x, use = "gam")  
#> 
#> Title:
#>  Generalized Additive Modeling 
#> 
#> Formula:
#>  Y ~ X1 + X2 + X3
#> 
#> Family:
#>  gaussian identity 
#> 
#> Model Parameters:
#> (Intercept)           X1           X2           X3  
#>     0.01578      0.73967      0.25128     -0.50611

# Projection pursuit modelling
regFit(Y ~ X1 + X2 + X3, data = x, use = "ppr") 
#> 
#> Title:
#>  Projection Pursuit Regression 
#> 
#> Formula:
#>  Y ~ X1 + X2 + X3
#> 
#> Family:
#>  gaussian identity 
#> 
#> Model Parameters:
#> -- Projection Direction Vectors --
#>        term 1     term 2
#> X1  0.7950116 -0.4422500
#> X2  0.2733278 -0.4863312
#> X3 -0.5415242 -0.7535894
#> -- Coefficients of Ridge Terms --
#>    term 1    term 2 
#> 0.9163087 0.0439332

# Feed-forward neural network modelling   
regFit(Y ~ X1 + X2 + X3, data = x, use = "nnet") 
#> 
#> Title:
#>  Feedforward Neural Network Modeling 
#> 
#> Formula:
#>  Y ~ X1 + X2 + X3
#> 
#> Family:
#>  gaussian identity 
#> 
#> Model Parameters:
#>    a 3-2-1 network with 11 weights
#>    options were - linear output units 
#>  [1]  3.3664690  0.5597762  0.2646774 -0.5300914  0.8276914 -0.4493467
#>  [7] -0.1400424  0.2787105 -0.5420174  5.4429808 -6.7838054

# Polychotonous Multivariate Adaptive Regression Splines
regFit(Y ~ X1 + X2 + X3, data = x, use = "polymars")
#>          1          2          3          4          5          6 
#>  0.9145273  1.1607611  1.0482997 -0.5673597 -0.4692621 -1.3336450 
#>           X1          X2          X3
#> 1  1.8197351 -0.39077723  0.24075985
#> 2  1.3704395  0.39665330 -0.02049151
#> 3  1.1963182  0.78156956  0.29685497
#> 4 -0.4068792 -0.01912605  0.55061347
#> 5 -0.6109788 -1.94431293 -0.71396821
#> 6 -1.5089120 -0.24550669  0.38003407
#> 
#> Title:
#>  Polytochomous MARS Modeling 
#> 
#> Formula:
#>  Y ~ X1 + X2 + X3
#> 
#> Family:
#>  gaussian identity 
#> 
#> Model Parameters:
#>   pred1 knot1 pred2 knot2       coefs          SE
#> 1     0    NA     0    NA  0.01577838 0.009803798
#> 2     1    NA     0    NA  0.73967249 0.009930477
#> 3     3    NA     0    NA -0.50611270 0.010729997
#> 4     2    NA     0    NA  0.25127670 0.010419817

Installation

To get the current released version from CRAN:

install.packages("fRegression")
Metadata

Version

4021.83

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows