Skip to content
Prev 345380 / 398502 Next

How to calculate correlation of a vector in R?

k <- sigma^2 * exp( -1/(2*l^2) * outer( v,v,FUN=function(x,y){(x-y)^2}))

but perhaps you should look at the e1071 package instead?
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
On November 2, 2014 4:19:56 PM PST, C W <tmrsg11 at gmail.com> wrote: