```python
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
```


```python
solve(x+3-4,x)
```




    [1]



La orden Matrix() es una función de sympy para crear matrices. Donde () es el argumento de la función y para crear las matrices tenemos que usar corchetes cuadrados.


```python
A = Matrix([[3,8],[7,-2]])
```


```python
A
```




    Matrix([
    [3,  8],
    [7, -2]])




```python
A.transpose()
```




    Matrix([
    [3,  7],
    [8, -2]])




```python
A.T
```




    Matrix([
    [3,  7],
    [8, -2]])




```python
A.inv()
```




    Matrix([
    [1/31,  4/31],
    [7/62, -3/62]])




```python
X = Matrix([[1,0],[1,1],[1,2],[1,3]])
```


```python
X
```




    Matrix([
    [1, 0],
    [1, 1],
    [1, 2],
    [1, 3]])




```python
X1 = X.T
```


```python
X1
```




    Matrix([
    [1, 1, 1, 1],
    [0, 1, 2, 3]])




```python
X2 = X1*X
```


```python
X2
```




    Matrix([
    [4,  6],
    [6, 14]])




```python
X3 = X2.inv()
```


```python
X3
```




    Matrix([
    [ 7/10, -3/10],
    [-3/10,   1/5]])




```python
y = Matrix([[1],[1],[2],[2]])
```


```python
y
```




    Matrix([
    [1],
    [1],
    [2],
    [2]])




```python
X4 = X1*y
```


```python
X4
```




    Matrix([
    [ 6],
    [11]])




```python
beta = X3*X4
```


```python
beta
```




    Matrix([
    [9/10],
    [ 2/5]])




```python

```

24004a4513600760584ce847d73f4d2343e145a0
ipynb
Jupyter Notebook
matrices.ipynb
CogniMath/regression_matrices
1f8a384807dfc65f6e61462927f41cbcb500596c
MIT
matrices.ipynb
CogniMath/regression_matrices
1f8a384807dfc65f6e61462927f41cbcb500596c
MIT
matrices.ipynb
CogniMath/regression_matrices
1f8a384807dfc65f6e61462927f41cbcb500596c
MIT
Qwen/Qwen-72B
1. YES
2. YES