简体   繁体   English

预测曲线拟合MATLAB

[英]Predictive curve fitting matlab

I have a question about curve fitting, I have many curves like the one in the picture. 我对曲线拟合有疑问,我有很多曲线,如图片中的曲线。

X axis : time Y axis : temperature X轴:时间Y轴:温度

Each sample comes out every 30s. 每个样本每30s出现一次。

GOAL : predict the value at the end of the transient 目标:预测瞬变结束时的值

What would you do in this situation? 在这个情况下,你会怎么做? What I am doing is this : for every new sample I start a new fitting (and so each fitting is independent from the previous one) and check the value of the fitted curve 2 hours (all curves I have set before 2h) after the start of the measurement. 我正在做的是:对于每个新样本,我都会开始一个新的拟合(因此每个拟合都独立于先前的拟合),并在开始后2小时(我在2h之前设置的所有曲线)中检查拟合曲线的值测量的 If for a number (let's say 5) of subsequent fitting the value in the future stays more or less the same(+-0.2°C) I so assume that the estimation is the right one. 如果对于后续拟合的数量(比如说5个),将来的值大致保持相同(+ -0.2°C),那么我认为估算是正确的。

This approach seems to me far too simple and I think I am not exploiting all information. 在我看来,这种方法太简单了,我认为我没有利用所有信息。 For example the info of the error I am making punctually (eg at minute 4:00 I predict and at 4:30 I see that I am doing an error). 例如,我准时做出的错误信息(例如,我预测的第4:00分钟,而我在4:30看到我正在执行错误)。

在此处输入图片说明

In the picture the red part of the curve is excluded (but the real data in the future passes through it). 在图片中,曲线的红色部分被排除了(但是将来的真实数据会通过它)。 the estimation is the blue one. 估计是蓝色的。 You see in this case I don't have a good prediction... In general I have also more flat curves. 您会发现在这种情况下,我的预测并不理想...一般来说,我的曲线也更平坦。

Based on the comments above, I tried to formulate an answer as no one else is giving some input . 根据以上评论,我试图提出一个答案,因为没有其他人可以提供一些意见

I think your are using a good basic procedure. 我认为您正在使用良好的基本程序。 Better results may be obtained by using a more appropriate fitting curve, which includes all the dominant dynamics, but avoids overfitting of the data. 通过使用更合适的拟合曲线可以获得更好的结果,该拟合曲线包括所有主要动态,但避免了数据的过度拟合 Based on your figure, the simplest form I could think of is: 根据您的数据,我能想到的最简单的形式是:

s + a(1-e^(-t/tau))

with parameters s (the initial temperature), a (amplitude = steady state value) and tau (dominant time constant). 带有参数s (初始温度), a (振幅=稳态值)和tau (主要时间常数)。 As you mentioned yourself, limiting the allowed range for the parameters may avoid overfitting and increase the quality of your estimation. 正如您自己提到的那样,限制参数的允许范围可以避免过度拟合并提高估计质量。

Using a random high order function, like you are using now, may give good interpolation results, but are dangerous to use for extrapolation, because strange effects may occur outside the fitting region. 像您现在正在使用的那样,使用随机的高阶函数可能会提供良好的插值结果,但由于可能会在拟合区域之外发生奇怪的影响,因此使用插值法很危险。

Alternatives 备择方案

Using the error (eg. correcting for the extrapolated error) may be possible, but is tricky and may not always give good results. 使用该错误 (例如,校正外推错误)是可能的,但是很棘手,并且可能不会总是给出良好的结果。

Training a neural network to perform the estimation is probably overkill, but may give better results if applied correctly. 训练神经网络来执行估计可能会过大,但是如果正确应用,可能会得到更好的结果。 Note that you need a lot of training data which should be representative for the data for which you will use the neural network later on. 请注意,您需要大量的训练数据,这些数据将代表以后将使用神经网络的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM