####################################### # SM Statistica multivariata. # X^{COM}. Sm.com = function (X) (nrow(X)-1)*cov(X) Sm.rango = function (X,scala=1,metodo='first') apply(X,2,S.rango,scala=scala,metodo=metodo) Sm.tra01 = function (X) apply(X,2,S.tra01) ####################################### # SME Statistica multivariata - elaborazione grafica. # Dall'alto in basso se dir==2. Sme.biprofilo = function (v,alt, scala=1,dir=1) {y=if(dir==1) seq(0,alt,length=length(v)) else seq(alt,0,length=length(v)) xdes=scala*v; xsin=-scala*rev(v) c(xdes+1i*y,xsin+1i*rev(y))} ####################################### # SMG Statistica multivariata geometrica. # X^{CE}. Smg.cen = function (X) apply(X,2,function (x) x-mean(x)) # X^{NG}. Smg.ng = function (X) apply(X,2,Sg.ng) # MX. Smg.M = function (X) {n=nrow(X) apply(X,2, function (x) rep(mean(x),n))}