Documentation and implementation of llsq don't agree on data matrix structure

Open
#38 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
documentation

Research direction

Start with the documentation index and the llsq documentation example shown in the issue, then compare them with the documented trans option. Confirm which matrix orientation the implementation and example use; done means the index, API documentation, and example consistently describe the same data-matrix structure.

Written by the indexing model from the issue text.

Description

Unless I'm missing something, the implementation (and docs) of llsq don't agree with the statement on the documentation index that data matrices have features as rows and observations as columns.

In the following code from the llsq documentation, the number of observations is 1000, and the number of features is 3, but the observation matrix X has 1000 rows and 3 columns, and the output from llsq is a 3-vector. Note that the code does not use the trans option provided by llsq.

using MultivariateStats

# prepare data
X = rand(1000, 3)               # feature matrix
a0 = rand(3)                    # ground truths
y = X * a0 + 0.1 * randn(1000)  # generate response

# solve using llsq
a = llsq(X, y; bias=false)

# do prediction
yp = X * a
Dominant language
Julia
Stars
387
Forks
83
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaStats/MultivariateStats.jl

All issues in JuliaStats/MultivariateStats.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.