inv(A)*B or AB, which is more accurate for a full rank A and half rank B
My matrix is
>> A_2stepblock
A_2stepblock =
1.0e+06 *
Columns 1 through 6
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0.000024000000000
1.953050781823359 0.390611805629631 0.078122690980311 0.015624604167218 0.003124934027730 0.000624989444415
3.515506250666680 0.624981527842487 0.109372229170523 0.018749604166382 0.003124947222073 0.000499993666635
5.624833750582380 0.874977833364188 0.131247229164674 0.018749683332437 0.002499968333177 0.000299997466649
7.874800500277688 1.049977833317391 0.131247783327059 0.014999809999061 0.001499987333244 0.000119999493329
9.449800499856519 1.049982266616475 0.104998669993428 0.008999923999464 0.000599997466643 0.000024000000000
Columns 7 through 10
0 0 0 0.000001000000000
0 0 0.000001000000000 0
0 0.000002000000000 0 0
0.000006000000000 0 0 0
0 0 0 0
0.000124998416659 0.000024999788887 0.000004999978889 0.000001000000000
0.000074999366662 0.000009999957777 0.000001000000000 0
0.000029999873332 0.000002000000000 0 0
0.000006000000000 0 0 0
0 0 0 0
K>> rank(A_2stepblock)
ans =
10
and I need to calculate
A_2stepblock dA_2stepblock_dt / A_2stepblock
where
K>> dA_2stepblock_dt
dA_2stepblock_dt =
1.0e+06 *
Columns 1 through 7
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
3.515506250666680 0.624981527842487 0.109372229170523 0.018749604166382 0.003124947222073 0.000499993666635 0.000074999366662
5.624833750582380 0.874977833364188 0.131247229164674 0.018749683332437 0.002499968333177 0.000299997466649 0.000029999873332
7.874800500277688 1.049977833317391 0.131247783327059 0.014999809999061 0.001499987333244 0.000119999493329 0.000006000000000
9.449800499856519 1.049982266616475 0.104998669993428 0.008999923999464 0.000599997466643 0.000024000000000 0
9.449840399548277 0.839989359947423 0.062999467996248 0.003599984799861 0.000120000000000 0 0
Columns 8 through 10
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0.000009999957777 0.000001000000000 0
0.000002000000000 0 0
0 0 0
0 0 0
0 0 0
has a rank of 5.
I tried both inv() and /, resulting in very different results for a gradient descent algorithm.
So, which is more accurate?My matrix is
>> A_2stepblock
A_2stepblock =
1.0e+06 *
Columns 1 through 6
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0.000024000000000
1.953050781823359 0.390611805629631 0.078122690980311 0.015624604167218 0.003124934027730 0.000624989444415
3.515506250666680 0.624981527842487 0.109372229170523 0.018749604166382 0.003124947222073 0.000499993666635
5.624833750582380 0.874977833364188 0.131247229164674 0.018749683332437 0.002499968333177 0.000299997466649
7.874800500277688 1.049977833317391 0.131247783327059 0.014999809999061 0.001499987333244 0.000119999493329
9.449800499856519 1.049982266616475 0.104998669993428 0.008999923999464 0.000599997466643 0.000024000000000
Columns 7 through 10
0 0 0 0.000001000000000
0 0 0.000001000000000 0
0 0.000002000000000 0 0
0.000006000000000 0 0 0
0 0 0 0
0.000124998416659 0.000024999788887 0.000004999978889 0.000001000000000
0.000074999366662 0.000009999957777 0.000001000000000 0
0.000029999873332 0.000002000000000 0 0
0.000006000000000 0 0 0
0 0 0 0
K>> rank(A_2stepblock)
ans =
10
and I need to calculate
A_2stepblock dA_2stepblock_dt / A_2stepblock
where
K>> dA_2stepblock_dt
dA_2stepblock_dt =
1.0e+06 *
Columns 1 through 7
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
3.515506250666680 0.624981527842487 0.109372229170523 0.018749604166382 0.003124947222073 0.000499993666635 0.000074999366662
5.624833750582380 0.874977833364188 0.131247229164674 0.018749683332437 0.002499968333177 0.000299997466649 0.000029999873332
7.874800500277688 1.049977833317391 0.131247783327059 0.014999809999061 0.001499987333244 0.000119999493329 0.000006000000000
9.449800499856519 1.049982266616475 0.104998669993428 0.008999923999464 0.000599997466643 0.000024000000000 0
9.449840399548277 0.839989359947423 0.062999467996248 0.003599984799861 0.000120000000000 0 0
Columns 8 through 10
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0.000009999957777 0.000001000000000 0
0.000002000000000 0 0
0 0 0
0 0 0
0 0 0
has a rank of 5.
I tried both inv() and /, resulting in very different results for a gradient descent algorithm.
So, which is more accurate? My matrix is
>> A_2stepblock
A_2stepblock =
1.0e+06 *
Columns 1 through 6
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0.000024000000000
1.953050781823359 0.390611805629631 0.078122690980311 0.015624604167218 0.003124934027730 0.000624989444415
3.515506250666680 0.624981527842487 0.109372229170523 0.018749604166382 0.003124947222073 0.000499993666635
5.624833750582380 0.874977833364188 0.131247229164674 0.018749683332437 0.002499968333177 0.000299997466649
7.874800500277688 1.049977833317391 0.131247783327059 0.014999809999061 0.001499987333244 0.000119999493329
9.449800499856519 1.049982266616475 0.104998669993428 0.008999923999464 0.000599997466643 0.000024000000000
Columns 7 through 10
0 0 0 0.000001000000000
0 0 0.000001000000000 0
0 0.000002000000000 0 0
0.000006000000000 0 0 0
0 0 0 0
0.000124998416659 0.000024999788887 0.000004999978889 0.000001000000000
0.000074999366662 0.000009999957777 0.000001000000000 0
0.000029999873332 0.000002000000000 0 0
0.000006000000000 0 0 0
0 0 0 0
K>> rank(A_2stepblock)
ans =
10
and I need to calculate
A_2stepblock dA_2stepblock_dt / A_2stepblock
where
K>> dA_2stepblock_dt
dA_2stepblock_dt =
1.0e+06 *
Columns 1 through 7
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
3.515506250666680 0.624981527842487 0.109372229170523 0.018749604166382 0.003124947222073 0.000499993666635 0.000074999366662
5.624833750582380 0.874977833364188 0.131247229164674 0.018749683332437 0.002499968333177 0.000299997466649 0.000029999873332
7.874800500277688 1.049977833317391 0.131247783327059 0.014999809999061 0.001499987333244 0.000119999493329 0.000006000000000
9.449800499856519 1.049982266616475 0.104998669993428 0.008999923999464 0.000599997466643 0.000024000000000 0
9.449840399548277 0.839989359947423 0.062999467996248 0.003599984799861 0.000120000000000 0 0
Columns 8 through 10
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0.000009999957777 0.000001000000000 0
0.000002000000000 0 0
0 0 0
0 0 0
0 0 0
has a rank of 5.
I tried both inv() and /, resulting in very different results for a gradient descent algorithm.
So, which is more accurate? matrix inverse, linear algebra MATLAB Answers — New Questions