Scaling one dataset to fit another dataset

5 views (last 30 days)
I am trying to fit one dataset with another dataset. Dataset 1 is defined by (x,y) where x and y are colum vectors. Dataset 2 is defined by (v,t) where v and t are also column vectors. The challenge here is that the scaling factor needs to be of the form: M^z1 * N^z3 * P^z4 * U^z5 when v < 0.065
for v >0.065, the scaling factor needs to be M^z2 * N^z3 * P^z4 * U^z5
where M, N, P and U are constant based on the system properties and can be readliy calculated. However, I do not know how to use matlab to calculate the values of z1, z2, z3, z4 and z5 for the best fit possible. I tried using fminsearch without any success. Can matlab handle this problem?
Thanks,
Kings
  2 Comments
Matt J
Matt J on 3 Aug 2022
Edited: Matt J on 3 Aug 2022
The problem is over-parametrized. There are infinite choice of the z1...z5 that produce a given set of scaling factors.
KingsOz
KingsOz on 3 Aug 2022
@Matt J What if I fix the values of z3, z4, and z5 so that I only have to solve for z1 and z2. Is this possible with matlab? Thanks

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 3 Aug 2022
It is not clear what is being scaled, or how x y v t fit in here other than the condition for v.
But suppose you break the data up into the two cases. Now for each case take log() of the scaling factor. log(M)*z1 + log(N)*z3 and so on. Decrease z1 by 1 and you can exactly compensate by raising z3 to balance the equation. Therefore the system has no definite solution.
  2 Comments
KingsOz
KingsOz on 3 Aug 2022
@Walter Roberson I am trying to scale t to match y, both are column vectors of the same size (60x1) in the datasets. x and v are column vectors of size (60x1) representing time and are essentially equal (for example 0, 0.005, 0.01, 0.015 etc.). Thus, the difference is the amplitude of the plot t and y.
Walter Roberson
Walter Roberson on 3 Aug 2022
so
y ~= t * M^z1 * N^z3 * P^z4 * U^z5
for the first case.
Take the log of both sides. If you fixed all of z except 1 then move those values to the left. Divide each left by its corresponding t and by M. Take the mean to arrive at z1

Sign in to comment.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!