Scaling one dataset to fit another dataset
5 views (last 30 days)
Show older comments
KingsOz
on 3 Aug 2022
Commented: Walter Roberson
on 3 Aug 2022
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
Accepted Answer
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
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
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!