# How to choose the state space model for 1 axis gyroscope to implemnt a good kalman filter

I am using this gyroscope in order to measure the rotation of my robot around the z axis. I want to implement a kalman filter in order to improve the values. What i came with since now is this space model:

$$θ(k+1)=θ(k)+dt*θ'(k)+w(k)$$ $$y(k)=θ(k)+z(k)$$ where $θ$ is the angle, $θ'$ is the angular rate given by the gyro and $w$ is the noise. (I hold up my gyro and measured 50 values while it was steady and find out that the variance is equal to 0.0002). What i want to ask:

1. is what i did is correct?
2. How can i find out $z(k)$? .According to the data sheet noise density is equal to 0.03 dps/sqrt(hz),how can i use this information to find out $z(k)$ and correct $w(k)$ if it is wrong.

Assuming the angular velocity is constant (i.e. $\dot{\theta}_{k+1} = \dot{\theta}_{k}$) It seems to me the state vector should look like this
$$\underbrace{ \begin{bmatrix} \theta_{k+1} \\ \dot{\theta}_{k+1} \end{bmatrix}}_{\textbf{x}_{k+1}} = \underbrace{ \begin{bmatrix} 1 & \Delta t \\ 0 & 1 \end{bmatrix} }_{F} \begin{bmatrix} \theta_{k} \\ \dot{\theta}_{k} \end{bmatrix} + w_{k+1}$$
\begin{align*} y_{k+1} &= h(\textbf{x}_{k+1}) + z_{k+1} \\ &= \underbrace{ \begin{bmatrix} 0 & 1 \end{bmatrix}}_{H} \begin{bmatrix} \theta_{k+1} \\ \dot{\theta}_{k+1} \end{bmatrix} + z_{k+1} \end{align*}
where $w_{k+1}$ is the process noise not the sensor noise (be careful). You could assume it to be zero if you think there is no noise affects your state vector and the noise only comes from the sensor (i.e. $z_{k+1}$) and it must be Gaussian noise with zero mean and known variance (i.e. $\mathcal{N}(0, \sigma^{2})$). Once you get the matrices and the noise parameters, applying Kalman filter is straightforward. Hope this helps