Check if a matrix is diagonalizable in R Programming Language

0 votes

I've created a matrix and I would like to know if it is diagonalizable. How is this done in the R programming language?

Dec 24, 2018 in Data Analytics by Sophie may
• 9,870 points
54 views

1 answer to this question.

0 votes

On a given matrix, a, the first way is to take the eigen vectors times the diagonal of the eigen values times the inverse of the original matrix. That should give us back the original matrix. In R that looks like:

a <- matrix( c(1:16), nrow = 4)
p <- eigen(m)$vectors
d <- diag(eigen(a)$values)
p %*% d %*% solve(p)
a

so in that example p %*% d %*% solve(p) should be the same as a

answered Dec 24, 2018 by Tyrion anex
• 8,310 points

Related Questions In Data Analytics

0 votes
1 answer

Check if the object(variable) is defined in R

You can use the exists(): > exists("toFindUnknown") [1] FALSE > ...READ MORE

answered Apr 17, 2018 in Data Analytics by darklord
• 6,290 points
65 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26 in Data Analytics by anonymous
• 32,340 points
123 views
0 votes
1 answer

How to check if object is defines in R?

You can use the exists function for ...READ MORE

answered Nov 6, 2018 in Data Analytics by Kalgi
• 46,320 points
36 views
0 votes
1 answer

Can we have an if loop inside a for loop in R programming?

You're If loop doesn't have any condition ...READ MORE

answered Dec 21, 2018 in Data Analytics by Sophie may
• 9,870 points
53 views
0 votes
1 answer

Modular programming in R language

R provides support to create subscripts. For ex. ...READ MORE

answered Jan 31 in Data Analytics by Tyrion anex
• 8,310 points
34 views
0 votes
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21 in Data Analytics by anonymous
• 32,340 points
169 views
+9 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 8, 2018 in Data Analytics by Anmol
• 3,680 points
86 views
0 votes
1 answer

How can I perform word stemming in R

The tm package in R provides the stemDocument() function to stem the ...READ MORE

answered Aug 20, 2018 in Data Analytics by Anmol
• 3,680 points
95 views
0 votes
2 answers
0 votes
2 answers

R Programming error in if condition

Hi. Instead of breaking the line add it ...READ MORE

answered Aug 26 in Data Analytics by anonymous
• 32,340 points
67 views