Is it intentional that the builting linreg is so picky about its inputs? It
seems to me that the code is a one liner:
linreg{T<:Number}(X::AbstractVector{T}, y::AbstractVector{T}) = [ones(T,
size(X,1)) X] \ y
but forcing the types to be the same for both seems strange to me as it
throws errors for using unitranges, linranges etc..
Even the tests seem to do contortions to get around this, using x =
[float(1:10);] calls
would there be any downside to just having
linreg(X::AbstractVector, y::AbstractVector) = [ones(size(X,1)) X] \ y
which would cause an error if x or y weren't compatible as the `\` operator
would give an error.
Or is there a way to say that the are both abstract arrays of numbers but
not the same type?
I could try to figure out how to implement this one line change if it is
not the desired behavior and learn how to do a pull request.
If it is a design choice can someone explain why it isn't just a pain in
the ass?
Thanks so much.