Principal Components variance explained

30 views
Skip to first unread message

Brent Pedersen

unread,
Jan 12, 2017, 1:39:58 PM1/12/17
to gonum-dev
Hi, I'm using stat.PC and just verifying that I'm not missing a way to get the proportion of the total variance explained?

The way I can see is to take the sum of the the row-wise variances and then divide the pc.Vars() by that. 

thanks,
-Brent

Dan Kortschak

unread,
Jan 12, 2017, 4:07:19 PM1/12/17
to Brent Pedersen, gonum-dev

pov := pc.Vars(nil)
floats.Scale(1/floats.Sum(pov), pov)

--
afk
Dan

Brent Pedersen

unread,
Jan 12, 2017, 4:35:28 PM1/12/17
to Dan Kortschak, gonum-dev
perfect. Thank you.
Reply all
Reply to author
Forward
0 new messages