Skip to content

Commit

Permalink
avoid matrix A becoming vector if only one observation
Browse files Browse the repository at this point in the history
  • Loading branch information
stephens999 committed Oct 26, 2019
1 parent 8f07213 commit e8a7abc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/mix_opt.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ mixSQP <- function (matrix_lik, prior, pi_init = NULL,
# Add in observations corresponding to the prior.
A <- rbind(diag(k),matrix_lik)
w <- c(prior - 1,weights)
A <- A[w != 0,]
A <- A[w != 0,,drop=FALSE]
w <- w[w != 0]

# Fit the mixture weights using the mix-SQP algorithm.
Expand Down

0 comments on commit e8a7abc

Please sign in to comment.