Changed text to account for chapter reordering.
UKF and EKF chapters were reordered, and I needed to alter some text to reflect that.
This commit is contained in:
parent
592a354d1f
commit
9c43e01b9e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,6 @@ Created on Sun May 18 11:09:23 2014
|
||||
from __future__ import division
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from numpy.random import normal
|
||||
|
||||
|
||||
def plot_transfer_func(data, f, lims,num_bins=1000):
|
||||
@ -16,11 +15,13 @@ def plot_transfer_func(data, f, lims,num_bins=1000):
|
||||
|
||||
#plot output
|
||||
plt.subplot(2,2,1)
|
||||
plt.hist(ys, num_bins, orientation='horizontal',histtype='step')
|
||||
plt.hist(ys, num_bins, orientation='horizontal', histtype='step', lw=3)
|
||||
plt.ylim(lims)
|
||||
plt.gca().xaxis.set_ticklabels([])
|
||||
plt.title('output')
|
||||
|
||||
plt.axhline(np.mean(ys), ls='--', lw=2)
|
||||
|
||||
# plot transfer function
|
||||
plt.subplot(2,2,2)
|
||||
x = np.arange(lims[0], lims[1],0.1)
|
||||
@ -34,9 +35,23 @@ def plot_transfer_func(data, f, lims,num_bins=1000):
|
||||
|
||||
# plot input
|
||||
plt.subplot(2,2,4)
|
||||
plt.hist(data, num_bins, histtype='step')
|
||||
plt.hist(data, num_bins, histtype='step', lw=3)
|
||||
plt.xlim(lims)
|
||||
plt.gca().yaxis.set_ticklabels([])
|
||||
plt.title('input')
|
||||
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from numpy.random import normal
|
||||
import numpy as np
|
||||
|
||||
data = normal(loc=0.0, scale=1, size=500000)
|
||||
|
||||
def g(x):
|
||||
return (np.cos(4*(x/2+0.7)))*np.sin(0.3*x)-1.6*x
|
||||
|
||||
|
||||
plot_transfer_func (data, g, lims=(-3,3), num_bins=300)
|
Loading…
Reference in New Issue
Block a user