Doc codecov

ErrorsInVariables.jl

Error-in-variables estimation using Compact Genetic Algorithms in Julia

Usage

For the single variable case

julia> eive(dirtyx = dirtyx, y = y, otherx = nothing) 

and for the multiple regression

julia> eive(dirtyx = dirtyx, y = y, otherx = matrixofotherx) 

Note that the method assumes there is only one erroneous variable in the set of independent variables.

Example

Lets generate data from the model $y = 20 + 10x^* + \varepsilon$

import Random
using ErrorsInVariables

rng = Random.MersenneTwister(1234)
n = 30
deltax = randn(rng, n) * sqrt(3.0)
cleanx = randn(rng, n) * sqrt(7.0)
e = randn(rng, n) * sqrt(5.0)
y = 20.0 .+ 10.0 .* cleanx .+ e
dirtyx = cleanx
eive(dirtyx = dirtyx, y = y, otherx = nothing) 

The result is

EiveResult([20.28458307772922, 9.456757289676714])

whereas OLS estimates are

julia> X = hcat(ones(n), dirtyx);

julia> X \ y
2-element Vector{Float64}:
 17.94867860059858
  5.8099584879737876

and clearly biased towards to zero.

Citation

@article{satman2015reducing,
  title={Reducing errors-in-variables bias in linear regression using compact genetic algorithms},
  author={Satman, M Hakan and Diyarbakirlioglu, Erkin},
  journal={Journal of Statistical Computation and Simulation},
  volume={85},
  number={16},
  pages={3216--3235},
  year={2015},
  publisher={Taylor \& Francis}
}