Regression of a vector in a optimization problem

1 次查看(过去 30 天)
Hello everyone,
I need to fit experimental data to an analytical solution. The analytical solution has the form:
  • C(z,t) = C_eq*f(z,t,D)
where f(z,t,D) is a known function of time (t) and position (z), and D and C_eq are parameters to regress.
I have already determined D and C_eq using the routine fminsearch. However, I would like to consider that C_eq does not necessarily have to be constant and can change over time.
My question is whether it is possible to regress C_eq as a vector instead of a constant? In this case, which routine is the most appropriate?
P.D: parameter D could also be considered as a vector if necessary.
Thanks in advance.
  5 个评论
Ronny Rives
Ronny Rives 2019-7-31
Torsten,
In my calculations it is possible to determine an average C_eq at different times, i.e.,
C_eq1-->(0<t<t1);
C_eq2-->(t1<t<t2);
...
C_eqn-->(tn-1<t<tn).
Then,
C_eq = average(C_eq1;C_eq2;...C_eqn)
My question is whether it is possible to regress C_eq as a column vector without the need to manually divide my experimental data into time intervals?
Is there a routine in matlab, that allows to obtain a vector as a result of the regression instead of constant fitting parameter(s) (as in the case of fminsearch, lsqnonlin, etc.)?
Torsten
Torsten 2019-8-1
Use "lsqcurvefit" with the parameter vector x = (C_eq(1),C_eq(2),...,C_eq(n)).

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2019-8-13
As the others have said, all regression routines in the Optimization Toolbox allow you to represent the unknown variable in vector form. However, fminspleas might work especially well for your problem
since you only have one parameter that is intrinsically non-linear.

更多回答(1 个)

Sai Bhargav Avula
Sai Bhargav Avula 2019-8-13
As mentioned by Torsten, lsqcurvefit can be used to obtain a vector as a result of the regression. But those values use the entire data for getting the output values . For you particular case you should segment the data based on time stamps and perform lsqcurvefit in a for loop.
  1 个评论
Matt J
Matt J 2019-8-13
I don't think a loop would be appropriate here, actually, because as I understand it, the parameter D is shared by all time blocks.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by