The Stan Forums
Better formulation of X' * diag_matrix(v) * X
General
techniques
,
performance
bgoodri
April 22, 2020, 4:49pm
2
I do
crossprod(diag_pre_multiply(sqrt(v), X));
assuming
v
is positive.
2 Likes
Most efficient way of writing specific quadratic form
show post in topic
Related topics
Topic
Replies
Views
Activity
Most efficient way of writing specific quadratic form
Modeling
2
474
August 18, 2023
A contradiction result with hand calculation
Modeling
2
515
November 9, 2018
How to use 'diag_matrix' function to creat a diagonal matrix using a certain row of another matrix?
General
rstan
,
specification
4
426
October 5, 2021
Using row_vector (or vector) to represent a matrix
General
2
3038
May 26, 2017
Matrix multiplication
General
2
2760
April 5, 2018