Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

The data for these calculations are: knowns

Computer Science Sep 21, 2020

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.

Expert Solution

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.

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment