Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / The data for these calculations are: knowns

The data for these calculations are: knowns

Computer Science

The data for these calculations are:
knowns.xyz contains the spectra of twenty known samples, concentrations.xyz contains the concentrations of a target chemical T in each of the twenty samples, and unknowns.xyz gives the spectra of fifteen more samples whose concentrations of T you will predict. Concentrations2xyz is just to compare values afterwards.

Also, no particular reason for long rows vs. long columns.

Data to apply to regression is
*I thought I was on the right track here, but my plot is not really comparable to what it should be* Any help is greatly appreciated!

The fundamental relationship between a measured spectral data matrix S and the associ-
ated analyte concentration matrix C is
S = CP + N;
spectra are represented as matrix rows
The ordinary least squares (OLS) estimate of the concentration values is
C = SP^T(PP^T)^-1:
If we want to predict the concentration of just one target chemical T in a new sample, we
could simply use the first column of Pt(PPt)-1, call it a vector b^t, and calculate
c = sb^t (1)
where s is the sample's spectrum.

1. Inverse least squares. The simplest thing you can do is to say, I can just solve
Eq. 1 by least squares to get an estimate of b." This is called Inverse Least Squares (ILS).
(a) Solve Eq. 1 for an algebraic expression for b.
(b) There is an inverse in your answer. State what constraint that places on your ex-perimental design, i.e. , what balance is required between numbers of samples, wave-lengths, pure components, etc. to guarantee that the inverse will exist?
(c) Select the intensities at the discete pixels 100, 200...1000 from the spectra in knowns
and call this your S matrix. (In Matlab, this would mean typing something like
>>S = S(100:100:end).) Use ILS to generate b, and then predict the concentration
of T in unknowns. Scatter-plot your predictions versus the true values, which are
provided in concentrations2.xyz.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

There are more points of confusion, such as the explanation starting with S = CP + N and C = SP^T(PP^T)^-1 goes in the wrong direction, but I have figured what you in fact need to do.

A correct explanation is to say that what you really want is to find some such matrix R that

C = S*R + errors (1)

Given known C and S, and if the spectrum was not so long, you could solve equation (1) by
taking the inverse of (S'*S), that is

R = inv(S'*S)*S'*C

as I wrote in the attached script reg.m

However, if you take the long spectrum directly as in your file the matrix (S'*S) is DEGENERATE, because the length of the spectrum is LONGER than the number of experiments (20) you have done, and so its inverse DOES NOT EXIST.

In such cases one has to choose some ways to shorten the length of S. Your teacher suggested skipping every 100 points and so reducing the length of S to 10 < 20, which is a reasonable thing to do for you at this stage of your studies.

There are much better ways to shorten the input vector dimensions, but they are much more involved and we do not know whether you really need them at this stage.

please see the attached file.

Related Questions