How do I constrain a custom model to go through a certain point at a certain slope?
1 次查看(过去 30 天)
显示 更早的评论
I currently have two functions that I am trying to combine into a piecewise continuous function. The left side fits the data very well, so I want to have the right side's fit begin where the left side leaves off. For simplicity sake, let's call this point x. This means I want right_f(x) = left_f(x) and right_f'(x) = left_f'(x).
How do I go about doing this? For what it's worth, the function I'm fitting is of the form f(x)=A/(1+exp(-B*(x-C)))+D on both the left and right sides.
0 个评论
回答(1 个)
Veda Upadhye
2017-8-8
编辑:Veda Upadhye
2017-8-8
Hi Quinn,
There is a MathWorks blog post which talks about a few ways to constrain a polynomial to go through certain points. It includes some example code and you may customize your code accordingly.
Here is the link to it:
https://blogs.mathworks.com/pick/2015/12/11/polynomial-fit-passing-through-specified-points/
Hope this helps,
Veda
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!