"Correlation / Covariance" Spectrum (This time with "R")

April 18, 2012

(This article was first published on NIR-Quimiometría, and kindly contributed to R-bloggers)

I treat this matter with other software´s, and of course you can do the same with “R”.
Once I have the spectra of my samples with a math treatment, I want to draw a correlation spectrum to see which wavelengths have better correlation with the constituent of interest.
In this example I want to see the correlation of the wavelengths treated with MSC (Multiple Scatter Correction) respect  to the Moisture value of the Demo file, but only in the NIR range (1100 to 2498 nm = 700 data points).
+ xlab=”data points”,ylab=”log(1/R)”)
#We merge the correlation spectrum with
#the sample spectra treated with MSC.
+ xlab=”data points”,ylab=”log(1/R)”)
We can se the correlation plot between -1.00 and 1.00. We are interested in positive correlations, so it is easy to see where the bands for moisture are (combination band 1940nm aprox. and first overtone 1450 nm aprox.).
We can calculate also the covariance spectrum for moisture:
+ xlab=”data points”,ylab=”log(1/R)”)

To leave a comment for the author, please follow the link and comment on their blog: NIR-Quimiometría.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...


Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)