# cor2cov: Correlation Matrix to Covariance Matrix Conversion In jennasimit/flashfm: flexible and shared information fine-mapping

 cor2cov R Documentation

## Correlation Matrix to Covariance Matrix Conversion

### Description

Function to convert a correlation matrix to a covariance matrix.

### Usage

```cor2cov(cor.mat, sd, discrepancy = 1e-05)
```

### Arguments

 `cor.mat` the correlation matrix to be converted `sd` a vector that contains the standard deviations of the variables in the correlation matrix `discrepancy` a neighborhood of 1, such that numbers on the main diagonal of the correlation matrix will be considered as equal to 1 if they fall in this neighborhood

### Details

The correlation matrix to convert can be either symmetric or triangular. The covariance matrix returned is always a symmetric matrix.

### Note

The correlation matrix input should be a square matrix, and the length of sd should be equal to the number of variables in the correlation matrix (i.e., the number of rows/columns). Sometimes the correlation matrix input may not have exactly 1's on the main diagonal, due to, eg, rounding; discrepancy specifies the allowable discrepancy so that the function still considers the input as a correlation matrix and can proceed (but the function does not change the numbers on the main diagonal).

### Author(s)

Ken Kelley (University of Notre Dame; (KKelley@ND.Edu) and Keke Lai (the `MBESS` package), with modifications by Dustin Fife fife.dustin@gmail.com.

jennasimit/flashfm documentation built on July 31, 2022, 7:32 p.m.
{"ft_lang_label":"__label__en","ft_lang_prob":0.81932604,"math_prob":0.96994895,"size":1340,"snap":"2023-14-2023-23","text_gpt3_token_len":289,"char_repetition_ratio":0.18263473,"word_repetition_ratio":0.009569378,"special_character_ratio":0.20298508,"punctuation_ratio":0.11065574,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98708725,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-03-23T12:10:33Z\",\"WARC-Record-ID\":\"<urn:uuid:261c9592-4a05-4698-a569-06f856c24179>\",\"Content-Length\":\"42092\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f513e3b9-7716-4689-96de-b2f4dd6028fe>\",\"WARC-Concurrent-To\":\"<urn:uuid:1362e7e4-2a14-4172-b3e5-61e1dc6dd9c5>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/github/jennasimit/flashfm/man/cor2cov.html\",\"WARC-Payload-Digest\":\"sha1:I3QROJXL6PAK7CWGOS7YMHQZV6OTDFML\",\"WARC-Block-Digest\":\"sha1:3YXYMPV26UMUQOH576EHIJSKGWGNTOQ3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-14/CC-MAIN-2023-14_segments_1679296945144.17_warc_CC-MAIN-20230323100829-20230323130829-00204.warc.gz\"}"}