import tensorflow as tf
import numpy as np
class KalmanFilter(object):
def __init__(self, x=None, A=None, P=None, B=None, H=None, Q=None):
m = self._m = H.shape[0]
n = self._n = x.shape[0]
l = self._l = B.shape[1]
self._x = tf.Variable(x, dtype=tf.float32, name="x")
self._A = tf.constant(A, dtype=tf.float32, name="A")
self._P = tf.Variable(P, dtype=tf.float32, name="P")
self._B = tf.constant(B, dtype=tf.float32, name="B")
self._Q = tf.constant(Q, dtype=tf.float32, name="Q")
self._H = tf.constant(H, dtype=tf.float32, name="H")
self._u = tf.placeholder(dtype=tf.float32, shape=[l, 1], name="u")
self._z = tf.placeholder(dtype=tf.float32, shape=[m, 1], name="z")
self.
预测股票的变化--卡尔曼滤波
最新推荐文章于 2024-06-06 16:51:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)