How can I denormalize data normalized with 2-norm

7 views (last 30 days)
Hello I need help on denormalization. I have this dataset i Have normalize using 2-norm. Please how can I denormalize the data
DT = readtable("DT.xlsx")
DT = 72×7 table
Datetime Tb DH DN EB GH Z _________________________ ____ ___ ___ __ ___ ___ {''01/01/2007 00:00:00''} 22.7 0 0 0 0 155 {''01/01/2007 01:00:00''} 22.5 0 0 0 0 144 {''01/01/2007 02:00:00''} 22 0 0 0 0 132 {''01/01/2007 03:00:00''} 21.8 0 0 0 0 118 {''01/01/2007 04:00:00''} 21.6 0 0 0 0 104 {''01/01/2007 05:00:00''} 21.7 7 0 0 7 91 {''01/01/2007 06:00:00''} 22.2 81 27 2 84 77 {''01/01/2007 07:00:00''} 23.6 183 134 7 190 64 {''01/01/2007 08:00:00''} 25 311 272 0 311 51 {''01/01/2007 09:00:00''} 26 457 371 0 457 39 {''01/01/2007 10:00:00''} 27 536 465 0 536 31 {''01/01/2007 11:00:00''} 27.6 566 508 0 566 28 {''01/01/2007 12:00:00''} 27.6 506 442 0 506 32 {''01/01/2007 13:00:00''} 27.5 361 360 0 361 41 {''01/01/2007 14:00:00''} 27.2 313 246 0 313 53 {''01/01/2007 15:00:00''} 26.6 209 119 12 221 65
DN = normalize(DT,"norm",...
"DataVariables",["Tb","DH","DN","EB","GH","Z"])
DN = 72×7 table
Datetime Tb DH DN EB GH Z _________________________ _______ _________ ________ _________ _________ ________ {''01/01/2007 00:00:00''} 0.11092 0 0 0 0 0.17854 {''01/01/2007 01:00:00''} 0.10994 0 0 0 0 0.16587 {''01/01/2007 02:00:00''} 0.1075 0 0 0 0 0.15205 {''01/01/2007 03:00:00''} 0.10652 0 0 0 0 0.13592 {''01/01/2007 04:00:00''} 0.10555 0 0 0 0 0.11979 {''01/01/2007 05:00:00''} 0.10604 0.0041554 0 0 0.0023301 0.10482 {''01/01/2007 06:00:00''} 0.10848 0.048083 0.011558 0.0012417 0.027961 0.088694 {''01/01/2007 07:00:00''} 0.11532 0.10863 0.05736 0.0043458 0.063246 0.07372 {''01/01/2007 08:00:00''} 0.12216 0.18462 0.11643 0 0.10352 0.058745 {''01/01/2007 09:00:00''} 0.12705 0.27129 0.15881 0 0.15212 0.044923 {''01/01/2007 10:00:00''} 0.13193 0.31818 0.19905 0 0.17842 0.035708 {''01/01/2007 11:00:00''} 0.13487 0.33599 0.21746 0 0.18841 0.032252 {''01/01/2007 12:00:00''} 0.13487 0.30037 0.1892 0 0.16843 0.03686 {''01/01/2007 13:00:00''} 0.13438 0.2143 0.1541 0 0.12017 0.047227 {''01/01/2007 14:00:00''} 0.13291 0.1858 0.1053 0 0.10419 0.061049 {''01/01/2007 15:00:00''} 0.12998 0.12407 0.050939 0.0074499 0.073565 0.074872
I get this error when I try to denormalize it as below. please can I fix this? Thanks in advance
DA = denormalize(DN,"denorm",...
"DataVariables",["Tb","DH","DN","EB","GH","Z"])
Unrecognized function or variable 'denorm'.

Accepted Answer

Shaik mohammed ghouse basha
There isn't any function to directly get denormalize data from normalized data. As data and scaled version of data have same normalized values you can't get exact data from only normalized values.
Proof:
Consider data of N values of form and a scaled version of it by a constant k which will be of form .
After normalising,
an ith element in non scaled version will be
an ith element in scaled version wiil be , removing out of square root in denominator its cancels k in numerator and we are left with .
Hence we can say scaled version of a vector has same normalized values. So, we can't deduce the original data unless we know the euclidean norm of original data.
In case of 2-norm we need 2-norm of column to get denormalized values:
Normalized values are calculate by dividing each element with 2-norm of the column vector i.e, dividing a element with square root of sum of squares of all values in column. Hence by multiplying this to normalized values you can get denormalized values.
Here is an example of how to do it:
L1 = ["X"; "Y"];
L2 = [1; 7];
L3 = [2; 8];
L4 = [3; 9];
L5 = [4; 10];
L6 = [5; 11];
L7 = [6; 12];
DT = table(L1, L2, L3, L4, L5, L6, L7)
DT = 2×7 table
L1 L2 L3 L4 L5 L6 L7 ___ __ __ __ __ __ __ "X" 1 2 3 4 5 6 "Y" 7 8 9 10 11 12
DN = normalize(DT,"norm",...
"DataVariables",["L2", "L3", "L4", "L5", "L6", "L7"])
DN = 2×7 table
L1 L2 L3 L4 L5 L6 L7 ___ _______ _______ _______ _______ _______ _______ "X" 0.14142 0.24254 0.31623 0.37139 0.4138 0.44721 "Y" 0.98995 0.97014 0.94868 0.92848 0.91037 0.89443
DA = DN;
DA.L2 = norm(DT.L2, 2) * DA.L2;
DA.L3 = norm(DT.L3, 2) * DA.L3;
DA.L4 = norm(DT.L4, 2) * DA.L4;
DA.L5 = norm(DT.L5, 2) * DA.L5;
DA.L6 = norm(DT.L6, 2) * DA.L6;
DA.L7 = norm(DT.L7, 2) * DA.L7;
disp(DA)
L1 L2 L3 L4 L5 L6 L7 ___ __ __ __ __ __ __ "X" 1 2 3 4 5 6 "Y" 7 8 9 10 11 12
For your case, I think this should work fine but I can't run this since I don't have DT.xlsx file so I tried this method in above example:
DT = readtable("DT.xlsx");
DN = normalize(DT,"norm",...
"DataVariables",["Tb","DH","DN","EB","GH","Z"]) ;
DA = DN;
DA.Tb = norm(DT.Tb, 2) * DA.Tb;
DA.DH = norm(DT.DH, 2) * DA.DH;
DA.DN = norm(DT.DN, 2) * DA.DN;
DA.EB = norm(DT.EB, 2) * DA.EB;
DA.GH = norm(DT.GH, 2) * DA.GH;
DA.Z = norm(DT.Z, 2) * DA.Z;
disp(DA);

More Answers (0)

Categories

Find more on Exponents and Logarithms in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!