Articles by jrcuesta

CORRGRAM: Correlation Matrix (Wavelengths)

April 13, 2012 |

With the "Corrgram" package we can see patterns that can help us to recognize possible inter-correlations in a big matrix. This could be the case to see the correlation to every wavelength respect to all others. This way we can see the high correlation...

CORRGRAM: Correlation Matrix (Constituents)

April 12, 2012 |

Thanks a lot to Kevin W., for his comment in my previous post.Corrgram, it a nice package and I found very nice information to understand it a little bit better on Internet apart from the R help page.Corrgrams: Exploratory displays for correlation matr...

Correlation Matrix (Constituents)

April 9, 2012 |

It is important to understand as better as possible our sample set before to develop the regression. Continuing with the “Y” matrix (constituent’s matrix) we have to observe the correlation matrix.In the R Graph Gallery, we can get the code to dr...

Looking to the difference spectrum

April 9, 2012 |

From the previous post, we can make the difference spectrum (once the samples are sorted by moisture) between the sample with the lowest moisture value (position 1), from the sample with the highest moisture value (position 66). This spectra will help ...

Sorting the "Sample Sets" by constituents

April 8, 2012 |

I use to see the videos from:http://www.twotorials.com/and the video:How to order and sort stuff in Ris really useful to apply this concept to organize and understand better our sample sets before to proceed to develop a calibration.The idea of this po...

March 30, 2012 |

Comparing Spectra with different math treatments

March 30, 2012 |

It is amazing the quantity of graphics you can develop with R, and how you can show and manage  these graphics. Here in the same plot we compare the raw demo spectra, treated with MSC, SNV and with the first derivative (differences between consecu...

Dividing the Sample Set in two (Validation & Training)

March 29, 2012 |

We have in the Demo sample set “66” samples.  In this post we´ll see one way to divide the set in two parts: one for “Validation” and another for Training or Calibration.The selection will be random. And we are going to use the command:

SCRIPT for NIR "DEMO" Tutorial – 001

March 28, 2012 |

########### RAW NIR Demo Data##################################demo

March 26, 2012 |

March 25, 2012 |

March 24, 2012 |

Savitzky-Golay filters in R

March 17, 2012 |

Derivatives are a good way to extract information to our spectra. As we know NIR contents overlapping bands, and spectra must be treated with math operations in order to extract as much information as possible and to correlate it with the constituent &...

NIT: Fatty acids study in R – Part 007

March 14, 2012 |

Once we have chosen the model, we can continue acquiring spectra of new samples. Spectra is exported to a txt or csv file and we imported in R to be reprocessed.We use the function “predict” from the PLS package. I have done this with 20 new sample...

NIT: Fatty acids study in R – Part 006

March 12, 2012 |

In one of the columns, for constituent C16_0, one sample (57) has a value of “zero” (we could see this in the histogram).The reason for that is that the laboratory did not supply this value. The PLS regression will consider the lab value as cero, s...

NIT: Fatty acids study in R – Part 005

March 9, 2012 |

There are several algorithms to run a PLS regression (I recommend to consult the books: “Introduction to Multivariate Analysis in Chemometrics - Kurt Varmuza & Peter Filzmozer” and “Chemometrics with R – Ron Wehrens”).We are going to use ...

NIT: Fatty acids study in R – Part 004

March 7, 2012 |

It is clear that MSC does not remove the entire scatter in the raw spectra, so some of the information is hidden by the scatter. Improvement of the sample presentation will help to remove the scatter.We know that the first loading is much related to th...

NIT: Fatty acids study in R – Part 003

March 5, 2012 |

As I told you I´m a beginner in "R", so I realize that I have to prepare my data a little bit in order to continue from my previous post ( NIT: Fatty acids study in R - Part 002) after getting some errors. Anyway I´m really fascinated ...