Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The example for multivariate linear regression in the docs does not work. #79

Closed
YonghyunRyu opened this issue Nov 23, 2018 · 1 comment

Comments

@YonghyunRyu
Copy link

This example does not work because of DimensionMismatch

using MultivariateStats
X = rand(1000, 3)
A0, b0 = rand(3, 5), rand(1, 5)
Y = (X * A0 .+ b0) + 0.1 * randn(1000, 5)

# solve using llsq
sol = llsq(X, Y)

# extract results
A, b = sol[1:end-1,:], sol[end,:]

# do prediction
Yp = X * A .+ b
@wildart
Copy link
Collaborator

wildart commented Nov 28, 2018

Prediction calculation must have transposed b vector

Yp = X * A .+ b'

wildart added a commit to wildart/MultivariateStats.jl that referenced this issue Dec 21, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants