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!