{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/17591","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/17591/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/17591/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/17591/events","html_url":"https://github.com/JuliaLang/julia/issues/17591","id":167216789,"number":17591,"title":"Matrix division fails when applied on a square matrix with duplicate rows (and columns)","user":{"login":"rakeshvar","id":2840906,"avatar_url":"https://avatars.githubusercontent.com/u/2840906?v=3","gravatar_id":"","url":"https://api.github.com/users/rakeshvar","html_url":"https://github.com/rakeshvar","followers_url":"https://api.github.com/users/rakeshvar/followers","following_url":"https://api.github.com/users/rakeshvar/following{/other_user}","gists_url":"https://api.github.com/users/rakeshvar/gists{/gist_id}","starred_url":"https://api.github.com/users/rakeshvar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakeshvar/subscriptions","organizations_url":"https://api.github.com/users/rakeshvar/orgs","repos_url":"https://api.github.com/users/rakeshvar/repos","events_url":"https://api.github.com/users/rakeshvar/events{/privacy}","received_events_url":"https://api.github.com/users/rakeshvar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/linear%20algebra","name":"linear algebra","color":"aa8800"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-07-24T04:39:53Z","updated_at":"2016-07-26T09:13:47Z","closed_at":"2016-07-26T09:13:47Z","body":"I am trying to do least squares with a rank deficient matrix using  [the / operator](http://docs.julialang.org/en/release-0.4/stdlib/linalg/). It works in the general case, but fails when applied on a square symmetric matrix with duplicate rows (and columns).\r\n\r\n``` julia\r\n> n, p = 99, 8;\r\n> y = randn(n);\r\n> X = randn(n, p);\r\n> X[:, 1] = 1;\r\n\r\n# Rank deficient. X[:, 1] = X[:, 2] + X[:, 3] \r\n> X[:, 3] = 1 - X[:, 2];\r\n> (X\\y)'\r\n1x8 Array{Float64,2}:\r\n -0.0643163  -0.123173  0.0588565  0.0812868  -0.0363878  -0.0676099  -0.0715549  0.0175931\r\n> ((X'*X)\\(X'*y))'\r\n1x8 Array{Float64,2}:\r\n -0.124538  -0.0629509  0.119078  0.0812868  -0.0363878  -0.0676099  -0.0715549  0.0175931\r\n\r\n# Duplicate column. X[:, 1] = X[:, 3] = 1\r\n> X[:, 3] = 1;\r\n> (X\\y)'\r\n1x8 Array{Float64,2}:\r\n -0.00272991  -0.182029  -0.00272991  0.0812868  -0.0363878  -0.0676099  -0.0715549  0.0175931\r\n> (X'*X)\\(X'*y)\r\nERROR: Base.LinAlg.SingularException(8)\r\n in \\ at linalg/factorization.jl:25\r\n in \\ at linalg/dense.jl:448\r\n```"}}
{"actor":{"display_login":"tkelman"}}