## Question

What is the purpose of svd?

You asked us the following:

Compute an svd.

This is my question:

What is the purpose of svd?

I ran the following code to attempt to understand the value of the svd function on a basic level:

a <- matrix(

c(1, 2, 3, 10, 20, 30),

nrow=3,

ncol=2)

s <- svd(a)

s

I got the following output:

$d

[1] 37.60319 0.00000

$u

[,1] [,2]

[1,] -0.2672612 -0.5345225

[2,] -0.5345225 0.7745419

[3,] -0.8017837 -0.3381871

$v

[,1] [,2]

[1,] -0.09950372 -0.99503719

[2,] -0.99503719 0.09950372

I don't understand what value those numbers bring to a basic dataset like this:

[,1] [,2]

[1,] 1 10

[2,] 2 20

[3,] 3 30

## Answers and follow-up questions

** Answer or follow-up question 1** Dear student,

'What is the purpose of svd?'

SVD is explained In Section '2.4.3.11 Text Mining', subsection 'Dimension reduction'.

As the title says, the purpose of SVD is to reduce the number of dimensions.

The firsts sentence in that subsection reads:

'In order to further reduce the number of columns in our document-by-term matrix (dtm)

we use Latent Semantic Indexing (LSI)'. In the same paragraph you'll read:

'Our approach to LSI is Singular Value Decomposition (SVD)'.

Please note that a dtm is simply a matrix (rows and variables).

As to your example:

d is a measure of the information contained in the resulting singular vector (concept; linear combination).

As you can see, the second singular vector has d=0. This means it does not contain information.

Therefore we can drop that singular vector in subsequent analyses (i.e., we reduce the number of

dimensions from 2 variables to 1 variable).

As further explained in the code Section '2.4.3.11 Text Mining':

u contains the singular vectors (instance-concept matrix).

v contains the loadings of variables on concepts (variable-concept matrix)

d contains how much information is contained in the concepts (concept vector)

Michel Ballings

Sign in to be able to add an answer or mark this question as resolved.