How can I denormalize the equation in Matlab automatically ?

Actually, I have normalized my data before run the software that I have automatically (works in excel sheet and the data used is attached).The data scaled from [0 to 1] and getting an equation. My question is how can I re-normalize the equation to be written with actual data automatically? As I am doing that manually like this.
X = (Xi - Xmin)/(Xmax - Xmin).
Y = (Yi- Ymin)/(Ymax -Ymin)
Many thanks

2 Comments

I'm not clear what you're asking here. If you've loaded the data, what variables are you working with? If you haven't loaded it, I don't see how you can recover non-normalized values from normalized data.
ND
ND on 12 Jan 2016
Edited: ND on 13 Jan 2016
I normalized the data and put it in a software works like neural network gives me equation but I need to use this equation further , so I should re scale it again to be in actual data.

Sign in to comment.

Answers (2)

denormalized_X = normalized_X * (Xmax - Xmin) + Xmin;

3 Comments

Dear Walter, I do not know what this command does ?
I have actual data (input & output) normalized automatically with this range [0 1] this is inherited in the software that I used and gives me model (mathematical equation) likes this
Y = 2.7058* X -3.6775* X^2 +1.9762* X^3 - 0.006602
How can I denormalize this equation to be in actual data ? * note that I have the actual data in the workspace.
Thanks
If that Y is the result of operating on the normalized data, then:
More generally, Y = C3*nx^3+C2*nx^2+C1*nx+C0 where nx is your normalized x. Then since your normalized x is nx = (x-xmin)/(xmax-xmin) you can substitute that into the Y equation, and clean up the answer a bit, to get
Y = (C3 * x^3 + (xmax * C2 - (C2 + 3*C3) * xmin) * x^2 + (xmax^2 * C1 - 2*(C1+C2) * xmin * xmax + (C1 + 2*C2 + 3*C3) * xmin^2) * x + C0 * xmax^3 -(3*C0+C1) * xmin * xmax^2 + (3*C0+2*C1+C2) * xmin^2 * xmax -(C0+C1+C2+C3) * xmin^3 ) / (xmax - xmin)^3
and now your Y is expressed in terms of the unnormalized x.
Here, xmin and xmax should be the minimum and maximum value normalized against, which might possibly be fixed values (depending on the setup), or might be min(x) and max(x) (in other setups.)
Since both X and Y are normalized, Walters equation gives you Yn. Then use his other equation
Y = Ymin + (Ymax-Ymin)*Yn
Hope this helps.
Greg

Sign in to comment.

No.
If you are using MATLAB NN training functions, you don't have to do anything because the defaults are
1. Automatic normalization of inputs and targets to [-1,1]
2. Automatic denormalization of outputs from [-1,1] to the original target scale.
However, before training I do use ZSCORE (standardize to zero-mean/unit-variance) to check for, modify and/or delete outliers.
However, inputs and targets are trained using the original scaling.
Hope this helps.
Thank you for formally accepting my answer

1 Comment

Hi Heath, It is not NN in Matlab, but it works like neural network.

Sign in to comment.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

ND
on 12 Jan 2016

Commented:

on 17 Jan 2016

Community Treasure Hunt

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

Start Hunting!