Last data update: 2014.03.03

R: Covariance Matrix with Respect to the Origin
covOriginR Documentation

Covariance Matrix with Respect to the Origin

Description

Estimates the covariance matrix with respect to the origin.

Usage

covOrigin(X, location = NULL, na.action = na.fail)

Arguments

X

a numeric data matrix or dataframe.

location

optional location value which serves then as the center instead of the origin.

na.action

a function which indicates what should happen when the data contain 'NA's. Default is to fail.

Details

The covariance matrix S_0 with respect to origin is given for a matrix X with n observations by

S_0=X'X/n.

Value

A matrix.

Author(s)

Klaus Nordhausen

See Also

cov

Examples

set.seed(654321)
cov.matrix <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol=3)
X <- rmvnorm(100,c(0,0,0),cov.matrix)
covOrigin(X)
rm(.Random.seed)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ICS)
Loading required package: mvtnorm
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ICS/covOrigin.Rd_%03d_medium.png", width=480, height=480)
> ### Name: covOrigin
> ### Title: Covariance Matrix with Respect to the Origin
> ### Aliases: covOrigin
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> set.seed(654321)
> cov.matrix <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol=3)
> X <- rmvnorm(100,c(0,0,0),cov.matrix)
> covOrigin(X)
         [,1]       [,2]       [,3]
[1,] 3.902364  2.8767021  1.2631774
[2,] 2.876702  5.1390797 -0.5610806
[3,] 1.263177 -0.5610806  2.2803316
> rm(.Random.seed)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>