Giter VIP home page Giter VIP logo

ols.jl's Introduction

ols.jl

Julia type for multiple (multivariate) regression using OLS. Performs least squared regression on linear equations of multiple independent variables

Author: Adam Savitzky

Ported from the Python implemented by Vincent Nijs http://www.scipy.org/Cookbook/OLS?action=AttachFile&do=get&target=ols.0.2.py

OLS can be used on the following types of equations:

y = a1 * x1 + a2 * x2 + ... + an * xn
Y = AX + E

Input

y = dependent variable
y_varnm = string with the variable label for y
x = independent variables, note that a constant is added by default
x_varnm = list of variable labels for the independent variables

Usage

## Instantiate a new ols type
reg = ols(y, x, "y", ["x1", "x2", "x3"])
println("Coefficientss: $(reg.b)")
println("R-Squared: $(reg.R2)")
println("F-Statistic: $(reg.F)")
summary(reg)

All available output:

  • b::Array{Float, 1} - Coefficients that minimize squared error
  • nobs::Int - Number of observations
  • ncoef::Int - Number of coefficients
  • df_e::Int - Degrees of freedom in error
  • df_r::Int - Degrees of freedom in result
  • er::Array - Error vector
  • sse::Float - Sum of the squared errors
  • se::Array{Float, 1} - Standard Error (deviation)
  • t::Array{Float} - T-statistic vector (one for each xi)
  • #p::Array - T-statistic p-value (not implemented)
  • R2::Float - R-Squared
  • R2adj::Float - Adjusted R-Squared (based on how many dof)
  • F::Float - F-statistic (one for each xi)
  • #Fpv::Float - F-statistic p-value (not implemented)

ols.jl's People

Contributors

adambom avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.