Programming the statistical procedures from SAS

Smoothing matrix denoted by "L"

Reply
Occasional Contributor
Posts: 10

Smoothing matrix denoted by "L"

Dear SAS Statistical Procedures Community,

I am Josephine Sabbagh, and I have alreay read the "SAS/STAT® 9.2 User’s Guide The LOESS Procedure (Book Excerpt)" in order to apply the Loess procedure to get a fitted curve for a specific model that I am working on.

 

The guide is very clear and easy to understand, but I still have to ask only one question about how to display the elements of the smoothing matrix denoted by "L" and described in page 3218.

 

Please note that displaying the trace of L works very easily, but I only need your help to know more about "L".

 

So if you may please tell me if "L" can be also called "Hat Matrix" or "Projection Matrix" and how to display its elements.

 

Your help will be much appreciated.

Thank you in advance!

SAS Super FREQ
Posts: 3,540

Re: Smoothing matrix denoted by "L"

You ask an interesting question, but I don't think you can output the L matrix from PROC LOESS. The L matrix is primarily a theoretical construct. It isn't explicitly formed by most PROC LOESS calls.

 

LOESS (which you can think of as LOcal EStimation) uses weighted nearest neighbor computations to obtain the predicted values. At a point (x_i, y_0 you can obtain yHat_i as a weighted sum of the k observations whose X value is closest to x_i.  When the x_i values are evenly spaced and the local polynomial is a constant (DEGREE=0), you might be able to write down the L matrix by hand.

 

What do you want to do with the L matrix? Perhaps there are other ways to accomplish your goals.

Occasional Contributor
Posts: 10

Re: Smoothing matrix denoted by "L"

I need to understand well how to display the elements of this matrix because it is very important for the computation of AICC, degree of freedom etc... So when I have to present my statistical study done by SAS using Proc Loess procedure, I might present it very detailed. That's why I need to output "L".

Kindly note that the my Data is attached. Can you explain to me "L" using my example?

 

SAS Super FREQ
Posts: 3,540

Re: Smoothing matrix denoted by "L"

I won't argue with you about whether you need to output L or not.  However, I do not know a way to get it automatically from PROC LOESS.  I suggest you talk to your supervisor or academic advisor to clarify whether he or she expects that kind of detail.

 

Yes, certain elements of the matrix L are used to compute statistics such as AICC and DOF. However, as shown in various papers by Cleveland (references in the doc), you do not need all of L, just the trace of certain matrices that depend on L.  For efficiency, PROC LOESS does not usually form L directly for these computations, but uses approximations.

 

Since you and I have different opinions about the importance of L, I'll let others comment and help. Good luck on your problem.

Occasional Contributor
Posts: 10

Re: Smoothing matrix denoted by "L"

@rick_SAS Thank you so much Mr Rick for your advice.Maybe I wasn't very clear by sending you my help request.I don't know wether you can help me find my solution by telling me maybe the formula that is used by SAS to find the elements of the diagonal of the smoothing matrix. This will at least help me know how does it work to find the trace, not even to calculate the elements.
Thank you in advance.
Ask a Question
Discussion stats
  • 4 replies
  • 257 views
  • 0 likes
  • 2 in conversation