Posts Tagged ‘ Matrix Computations ’

A self-similar Christmas tree

December 11, 2017
By
A self-similar Christmas tree

Happy holidays to all my readers! My greeting-card to you is an image of a self-similar Christmas tree. The image (click to enlarge) was created in SAS by using two features that I blog about regularly: matrix computations and ODS statistical graphics. Self-similarity in Kronecker products I have previously shown [...] The post A self-similar Christmas tree appeared first on The DO Loop.

Read more »

The singular value decomposition and low-rank approximations

August 30, 2017
By
The singular value decomposition and low-rank approximations

A previous article discussed the mathematical properties of the singular value decomposition (SVD) and showed how to use the SVD subroutine in SAS/IML software. This article uses the SVD to construct a low-rank approximation to an image. Applications include image compression and denoising an image. Construct a grayscale image The [...] The post The singular value decomposition and low-rank approximations appeared first on The DO Loop.

Read more »

Flip it. Flip it good.

July 31, 2017
By
Flip it. Flip it good.

A SAS user needed to convert a program from MATLAB into the SAS/IML matrix language and asked whether there is a SAS/IML equivalent to the fliplr and flipud functions in MATLAB. These functions flip the columns or rows (respectively) of a matrix; "LR" stands for "left-right" and "UD" stands for [...] The post Flip it. Flip it good. appeared first on The DO Loop.

Read more »

Difference operators as matrices

July 24, 2017
By
Difference operators as matrices

For a time series { y1, y2, ..., yN }, the difference operator computes the difference between two observations. The kth-order difference is the series { yk+1 - y1, ..., yN - yN-k }. In SAS, the DIF function in the DATA step computes differences between observations. The DIF function [...] The post Difference operators as matrices appeared first on The DO Loop.

Read more »

Rotation matrices and 3-D data

November 7, 2016
By
Rotation matrices and 3-D data

Rotation matrices are used in computer graphics and in statistical analyses. A rotation matrix is especially easy to implement in a matrix language such as the SAS Interactive Matrix Language (SAS/IML). This article shows how to implement three-dimensional rotation matrices and use them to rotate a 3-D point cloud. Define […] The post Rotation matrices and 3-D data appeared first on The DO Loop.

Read more »

Counting observations for which two events occur

October 31, 2016
By
Counting observations for which two events occur

Every year near Halloween I write an article in which I demonstrate a simple programming trick that is a real treat to use. This year's trick (which features the CMISS function and the crossproducts matrix in SAS/IML) enables you to count the number of observations that are missing for pairs […] The post Counting observations for which two events occur appeared first on The DO Loop.

Read more »

Visualize a weighted regression

October 5, 2016
By
Visualize a weighted regression

What is weighted regression? How does it differ from ordinary (unweighted) regression? This article describes how to compute and score weighted regression models. Visualize a weighted regression Technically, an "unweighted" regression should be called an "equally weighted " regression since each ordinary least squares (OLS) regression weights each observation equally. […] The post Visualize a weighted regression appeared first on The DO Loop.

Read more »

Absorbing Markov chains in SAS

July 13, 2016
By
Absorbing Markov chains in SAS

Last week I showed how to represent a Markov transition matrix in the SAS/IML matrix language. I also showed how to use matrix multiplication to iterate a state vector, thereby producing a discrete-time forecast of the state of the Markov chain system. This article shows that the expected behavior of […] The post Absorbing Markov chains in SAS appeared first on The DO Loop.

Read more »

Markov transition matrices in SAS/IML

July 7, 2016
By
Markov transition matrices in SAS/IML

Many computations in elementary probability assume that the probability of an event is independent of previous trials. For example, if you toss a coin twice, the probability of observing "heads" on the second toss does not depend on the result of the first toss. However, there are situations in which […] The post Markov transition matrices in SAS/IML appeared first on The DO Loop.

Read more »

Grids and linear subspaces

May 31, 2016
By
Grids and linear subspaces

A grid is a set of evenly spaced points. You can use SAS to create a grid of points on an interval, in a rectangular region in the plane, or even in higher-dimensional regions like the parallelepiped shown at the left, which is generated by three vectors. You can use […] The post Grids and linear subspaces appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe