Skip to content

Commit

Permalink
doc hints
Browse files Browse the repository at this point in the history
  • Loading branch information
palday authored Mar 2, 2021
1 parent d5b23cc commit 63c32db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/Xymat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Term with an explicit, constant matrix representation
Typically, an `FeTerm` represents the model matrix for the fixed effects.
!!! note
`FeTerm` is not the same as [`FeMat`](@ref)!
# Fields
* `x`: full model matrix
* `piv`: pivot `Vector{Int}` for moving linearly dependent columns to the right
Expand Down Expand Up @@ -79,6 +84,12 @@ isfullrank(A::FeTerm) = A.rank == length(A.piv)
A matrix and a (possibly) weighted copy of itself.
Typically, an `FeMat` represents the fixed-effects model matrix with the response (`y`) concatenated as a final column.
!!! note
`FeMat` is not the same as [`FeTerm`](@ref).
# Fields
- `xy`: original matrix, called `xy` b/c in practice this is `hcat(fullrank(X), y)`
- `wtxy`: (possibly) weighted copy of `xy` (shares storage with `xy` until weights are applied)
Expand All @@ -101,7 +112,7 @@ Base.eltype(::FeMat{T}) where {T} = T

Base.getindex(A::FeMat, i, j) = getindex(A.xy, i, j)

Base.length(A::FeMat) = length(A.wtxy)
Base.length(A::FeMat) = length(A.xy)

function *(adjA::Adjoint{T,<:FeMat{T}}, B::FeMat{T}) where {T}
adjoint(adjA.parent.wtxy) * B.wtxy
Expand Down
3 changes: 2 additions & 1 deletion src/linearmixedmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Linear mixed-effects model representation
* `formula`: the formula for the model
* `reterms`: a `Vector{AbstractReMat{T}}` of random-effects terms.
* `Xymat`: horizontal concatenation of a full-rank fixed-effects model matrix `X` and response `y` as an `FeMat{T}`
* `feterm`: the fixed-effects model matrix as an `FeMat{T}`
* `feterm`: the fixed-effects model matrix as an `FeTerm{T}`
* `sqrtwts`: vector of square roots of the case weights. Can be empty.
* `parmap` : Vector{NTuple{3,Int}} of (block, row, column) mapping of θ to λ
* `dims` : NamedTuple{(:n, :p, :nretrms),NTuple{3,Int}} of dimensions. `p` is the rank of `X`, which may be smaller than `size(X, 2)`.
Expand Down Expand Up @@ -295,6 +295,7 @@ function pushALblock!(A, L, blk)
push!(L, blk)
push!(A, deepcopy(isa(blk, BlockedSparse) ? blk.cscmat : blk))
end

function createAL(reterms::Vector{AbstractReMat{T}}, Xy::FeMat{T}) where {T}
k = length(reterms)
vlen = kchoose2(k+1)
Expand Down

0 comments on commit 63c32db

Please sign in to comment.