You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

706 lines
317 KiB
Plaintext

{
"metadata": {
"name": "WAFO Chapter 2"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"CHAPTER2 Modelling random loads and stochastic waves\n",
"====================================================\n",
"\n",
"Chapter2 contains the commands used in Chapter 2 of the tutorial and present some tools for analysis of random functions with respect to their correlation, spectral and distributional properties. The presentation is divided into three examples: \n",
"\n",
"Example1 is devoted to estimation of different parameters in the model.\n",
"Example2 deals with spectral densities and\n",
"Example3 presents the use of WAFO to simulate samples of a Gaussian process.\n",
"\n",
"Some of the commands are edited for fast computation. \n",
"\n",
"Section 2.1 Introduction and preliminary analysis\n",
"=================================================\n",
"\n",
"Example 1: Sea data\n",
"-------------------\n",
"Observed crossings compared to the expected for Gaussian signals\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import wafo\n",
"import wafo.objects as wo\n",
"xx = wafo.data.sea()\n",
"me = xx[:, 1].mean()\n",
"sa = xx[:, 1].std()\n",
"xx[:, 1] -= me\n",
"ts = wo.mat2timeseries(xx)\n",
"tp = ts.turning_points()\n",
"\n",
"cc = tp.cycle_pairs()\n",
"lc = cc.level_crossings()\n",
"lc.plot()\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEVCAYAAAD+TqKGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4jOf6B/DvSGIPYovIIkg0hASNqj20sbUUrSVOUaKt\nJa2l1EF7hFJbF7X9iqqlai0Va6glqC091qotnISIIPYsYpKZ5/fHczonkW0mmZl3lu/nuuY6zcz7\nvnPnPTH3PNv9qIQQAkRERPkooXQARERk2ZgoiIioQEwURERUICYKIiIqEBMFEREViImCiIgKxERB\nFu+9997D559/rnQ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OVlci8LPzw//93//h/Xr12PPnj1Kh0Nk\nNNu3b0d6ejrS0tIwbtw4BAQEGJQkiJRilkQxZMgQuLq6olGjRjmej4qKgp+fH3x9fTF79mzd89u3\nb8cbb7yRox+byNpt27YN7u7ucHd3x/Xr17F+/foiXYfdOWRuZul6OnLkCMqXL4+BAwfizz//BABo\nNBq89NJL2LdvH9zd3dGsWTOsW7cO9evX15331ltvITIy0tThERFRARzN8SZt2rRBfHx8judiYmLg\n4+MDb29vAEC/fv0QGRmJe/fuYcuWLTmmTxIRkXLMkijykpiYmGMxj4eHB06ePIl27dqhXbt2BZ7L\npjcRUdEUpRNJscHs4n7YC1l+xKIfU6ZMUTwGxsk4rTVGxmn8R1Eplijc3d1zTPFLSEjIUeKgMBER\nEYiOjjZBZEREtiU6OhoRERFF
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Average number of upcrossings per time unit\n",
"----------------------------------------------\n",
"Next we compute the mean frequency as the average number of upcrossings per time unit of the mean level (= 0); this may require interpolation in the crossing intensity curve, as follows. \n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"T = xx[:, 0].max() - xx[:, 0].min()\n",
"f0 = np.interp(0, lc.args, lc.data, 0) / T #! zero up-crossing frequency \n",
"print('f0 = %g' % f0)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"f0 = 0.224071\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Turningpoints and irregularity factor\n",
"----------------------------------------"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"fm = len(tp.data) / (2 * T) # frequency of maxima\n",
"alfa = f0 / fm # approx Tm24/Tm02\n",
"\n",
"print('fm = %g, alpha = %g, ' % (fm, alfa))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"fm = 0.456159, alpha = 0.491212, \n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Visually examine data\n",
"------------------------\n",
"We finish this section with some remarks about the quality of the measured data. Especially sea surface measurements can be of poor quality. We shall now check the quality of the dataset {\\tt xx}. It is always good practice to visually examine the data before the analysis to get an impression of the quality, \n",
"non-linearities and narrow-bandedness of the data.First we shall plot the data and zoom in on a specific region. A part of sea data is visualized with the following commands"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"ts.plot_wave('k-', tp, '*', nfig=1, nsub=1)\n",
"\n",
"axis([0, 2, -2, 2])\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEXCAYAAACqIS9uAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsfXl4E9X+/jvpnjRt06bpvlC6syPKTuuCLAIiqOwoYlkU\nwf2CegWvit7rFfSKV6kLisiioiIKyJWfRZYLXJW1rKV037ekaZO2Sc7vj35nyDIzmSRtU+i8z9Pn\naWZO5pzMzHnP57yfz/kcihBCIEKECBEiegwk7m6ACBEiRIjoWojEL0KECBE9DCLxixAhQkQPg0j8\nIkSIENHDIBK/CBEiRPQwiMQvQoQIET0MIvE7gcrKSowZMwYBAQF47rnn3N0cAEB8fDwOHDjQ5fVO\nnDgRX3zxRYdfV6fTYfLkyQgKCsKMGTM6/PoiOhY5OTmIiYnp9HokEgny8/M5z2/cuBFPPfVUp7eD\nC7t378bMmTPdVr9Q9AjiP3z4MEaMGIGgoCCEhIRg1KhR+P33352+XnZ2NlQqFTQaDd56660ObKnz\noCgKFEV1ah1r1qzBvHnzLI7t2bPH5lhH4JtvvkFVVRXq6uqwY8eODr9+T0ZXkXRXo7W1Fa+//jqe\nf/55AEBBQQEkEgkGDx5sUa6mpgbe3t7o1asXAOCNN97AxIkTLcokJSWxHvvqq68AcA9AkydPRm5u\nLs6ePdthv6szcNMTv0ajwaRJk7BixQrU19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czNz\nvqKiwuY79qJlli5divT0dOTl
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finding possible spurious points\n",
"------------------------------------\n",
"However, if the amount of data is too large for visual examinations one could use the following criteria to find possible spurious points. One must be careful using the criteria for extremevalue analysis, because\n",
"it might remove extreme waves that are OK and not spurious."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import wafo.misc as wm\n",
"dt = ts.sampling_period()\n",
"# dt = np.diff(xx[:2,0])\n",
"dcrit = 5 * dt\n",
"ddcrit = 9.81 / 2 * dt * dt\n",
"zcrit = 0\n",
"inds, indg = wm.findoutliers(ts.data, zcrit, dcrit, ddcrit, verbose=True)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Found 0 spurious positive jumps of Dx\n",
"Found 0 spurious negative jumps of Dx\n",
"Found 37 spurious positive jumps of D^2x\n",
"Found 200 spurious negative jumps of D^2x\n",
"Found 244 consecutive equal values\n",
"Found the total of 1152 spurious points\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Section 2.2 Frequency Modeling of Load Histories\n",
"---------------------------------------------------\n",
"Periodogram: Raw spectrum"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"Lmax = 9500\n",
"S = ts.tospecdata(L=Lmax)\n",
"S.plot()\n",
"axis([0, 5, 0, 0.7])\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEXCAYAAAC3c9OwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXl8TOf+xz+TpUiIWCsSBNGIPSRiCWKNKKEoSouWNu0P\nt67qbV1d6HJbpdqqezVtkWspaVVxLWmqpFVKLClto8QSRohIrZF98vz+OD0z58ycmTlnlpyZyff9\neuU1Z3nO83zPmcn3c77PqmGMM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hzg7uqA2DIJwHzIyMpCRkaHoGlUEQiPDs1RUVODEiRP4\n/vvvUVxcjN69e6NXr15o166dSVqhQBDyIQdPEDUH45fnxYsXW71GFYEIDg6GVqvV72u1Wn1VEk+L\nFi3QuHFj1KlTB3Xq1EH//v1x8uRJSYFwFaqzPcAVIgiCIDwbVdogoqKikJOTg9zcXJSXlyM1NRWJ\niYmiNKNHj8ZPP/0EnU6H4uJiHDlyBB06dFDDXMIMJEAE4dmoEkH4+Phg5cqViI+Ph06nw4wZMxAR\nEYHk5GQAQFJSEtq3b4/hw4ejS5cu8PLywtNPP00CQRAEUY1oGHPv90CNRgNXuAWNBnjiCWDduuop\n79AhoG9f82/xGg3g7Q1UVprPQ6sFWra0PRIYPRrYsYMiCYJwR+T4ThpJ7UBczVHSSGqCIOyBBIIg\nCIKQhASiGmHMcVEGvf0TBOFsSCCqkaVLAS964gRBuAnkrhyIteggK8txZVEEQRCEsyGBqEZczanz\n9rha4zpBEK4BCYQDcTdH6272
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Calculate moments \n",
"-------------------"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"mom, text = S.moment(nr=4)\n",
"print('sigma = %g, m0 = %g' % (sa, sqrt(mom[0])))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"sigma = 0.472955, m0 = 0.472955\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Section 2.2.1 Random functions in Spectral Domain - Gaussian processes\n",
"--------------------------------------------------------------------------\n",
"Smoothing of spectral estimate \n",
"----------------------------------\n",
"By decreasing Lmax the spectrum estimate becomes smoother."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"Lmax0 = 200; Lmax1 = 50\n",
"S1 = ts.tospecdata(L=Lmax0)\n",
"S2 = ts.tospecdata(L=Lmax1)\n",
"S1.plot('-.')\n",
"S2.plot()\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEXCAYAAABsyHmSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VHXa8PHvSS8kpEBCCmkEkiCElhBASlTKwmoQUJo+\nggIiu6isy76rD8s+oKuLYkHEgq6AWHEtgAoRUaJY6FVKCJBACiEEEtLLTM77x5CBkDaTdjLJ/bmu\nXM7p9wQz9/y6oqqqihBCCNEAVloHIIQQwnJJEhFCCNFgkkSEEEI0mCQRIYQQDSZJRAghRINJEhFC\nCNFgkkSEaEEzZ85k8eLFJp2bkpKClZUVFRUVzRbPhx9+yJgxY5rt/qLtkyQiLNLPP//MkCFDcHNz\nw9PTk6FDh7Jv375mfWZQUBA//PBDo+6hKAqKojRRRI1333338e233xq3raysOHv2rIYRCUtjo3UA\nQpgrLy+PO++8k9WrVzN58mRKS0vZuXMn9vb2zfpcRVGoa2yuTqfDxqb+P6nWPr63tccnWhcpiQiL\nc+rUKRRFYcqUKSiKgoODA6NGjaJ3794ArFu3jltvvZVHH30UNzc3IiIiqpQgrl69yqxZs/D19cXf\n35/FixdXqTJ655136NmzJ66urtxyyy0cPHiQ//mf/+H8+fPcdddduLi48OKLLxqrm9asWUNgYCAj\nR44E4N5778XHxwc3NzdGjBjB8ePHTXpfFRUVLFy4kM6dO9OtWze++eabKsfrinvdunUMHTqUv/3t\nb3h4eBASEkJ8fLzx2nXr1tGtWzdcXV0JCQnho48+Mu4fNmwYAMOHDwegT58+uLq68umnn9K7d2++\n/vpr433Ky8vp1KkThw8fNu0fS7R9qhAWJi8vT/X09FRnzJihbt26Vb1y5UqV42vXrlVtbGzUFStW\nqDqdTt2wYYPasWNHNScnR1VVVb377rvVRx55RC0qKlKzsrLUgQMHqqtXr1ZVVVU//fRT1c/PT923\nb5+qqqp6+vRp9dy5c6qqqmpQUJD6/fffG5+TnJysKoqizpg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6E\n33/XOhIhhNCGVGc1UlkZ2Nk1+2OEEKJFSHVWC5MEIoRozySJCCGEaDBJIg2Qnw/PPqt1FEIIoT1J\nIg2g14OHx/XtK1egbbYsCSFE3aRhvQkEBcHhw9CxY4s8Tgghmo0MNrzG0kesCyGEFqR3lhBCiBYj\nSUQIIUSDSRJpgFWrIClJ6yiEEEJ7kkQaYM0auHr1+nZxMeTmahePEEJoRZJIA1y8CF26XN9+5x1Y\nvFi7eIQQQiuSRBpg8WLw8rq+3akTXLqkXTxCCKEVTVY2tHSPPFJ1u0sXUBRtYhFCCC3JOBEhhBBG\nMk5ECCFEi5Ekco1eDytWaB2FEEJYFkki15SVmdY4fvQovPlm88cjhBCWQNpEzJScDCdOwLhxVfdn\nZoK7O9jbN/kjhRCixUibSCOVl9d9PDi4egIBmD0bEhObJyYhhGitpCRyg6QkGDsWTp9upqCEEKKV\nk5JII3h4GBaYEkIIYRoZbHjNTz8ZBgwWF0NFBVhJehVCiHrJR+U1X30Fv/0GRUV1J5B16wznCSGE\nkCRiVFwMTk71T18SHw/nzlXfX1gIGRnNE5sQQrRWkkSuueMOiI6u/7zCQkOyudn27TB3btPHJYQQ\nrZm0iVwzYYJp582bB716Vd/fubPM5CuEaH8kidykvNxQpWVTy2+mpjEiAN7e4OrafHEJIURrJONE\nbnL//XD33XDPPc0QlBBCtHLmfnZKEhFCCGEkgw0baO1auHBB6yiEEMKySBK5pqDAMMiwPvPnQ2lp\n88cjhBCWQBrWr3n0UdPO69u3
}
],
"prompt_number": 9
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Estimated autocovariance\n",
"----------------------------\n",
"Obviously knowing the spectrum one can compute the covariance\n",
"function. The following code will compute the covariance for the \n",
"unimodal spectral density S1 and compare it with estimated \n",
"covariance of the signal xx."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"Lmax = 85\n",
"R1 = S1.tocovdata(nr=1) \n",
"Rest = ts.tocovdata(lag=Lmax)\n",
"R1.plot('.')\n",
"Rest.plot()\n",
"axis([0, 25, -0.1, 0.25])\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEXCAYAAACDChKsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU9f7B/BPGA42yE5QZAhYZShoHVgc4MaJ4h4I1tbR\n2lbbWlu0v7rtUL+to9YtBbUVaxURFbfgtlQREBGMgCgbkRHO74+UhDCUhJAAed6vly9zkjue3IT7\n5Jxzz7kcxhgDIYQQIiU1ZQdACCGkeaIEQgghRCaUQAghhMiEEgghhBCZUAIhhBAiE0oghBBCZEIJ\nhBA56tKlCy5cuKDsMJoUXV1dpKSkKDsM0ggogRC58fLygpGREUpLS6VaT01NDcnJyTLvt7S0FMHB\nwejUqRN0dHTQsWNHBAQE4MmTJzJvU1ZxcXHo16+fwvdbl5kzZ6J169bQ1dUV/Tt06FCj7c/Lyws7\nd+6UeK6goADW1taNtk+iPJRAiFykpKQgNjYWpqamOHbsmNTrN2Q86/jx43H8+HGEhIQgPz8fd+/e\nhbu7O86cOSPzNqVVXl6usH1Jg8PhYOnSpSgoKBD98/Pza9T9EdVBCYTIxd69ezFo0CBMmzYNe/bs\nkXit+q/S3bt3w9PTEwBEv9ZdXFwkfh3v2LED9vb2aNeuHUaNGoX09PRa9xsVFYWoqCiEh4eje/fu\nUFNTg56eHubNm4fZs2cDAJ49ewZfX1+0a9cO9vb2+PXXX0XPa2lpIScnR7S927dvw8TEBAKBAI8e\nPcKAAQNgbGwMExMTTJ06FXl5eaJlra2tsW7dOjg7O0NXVxcCgQDW1tY4e/YsACA2Nha9evWCoaEh\nLC0tsWDBApSVlYnWV1NTw7Zt29CpUycYGhpi/vz5Eu9tx44d6Ny5M/T09PDOO+/g9u3borjHjRsH\nU1NT2NjYYPPmzfX9mERmzpyJ5cuXi8rR0dGwsrKSeG8bN26Ei4sLDAw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QgF27duHs2bOoqKgAn8/Hw4cPAdT8LKtS\nV1fHhAkTsGzZMhQWFuLJkyf44YcfJD4L0rxQAiENsnfvXsyePRs8Hg+mpqYwNTWFmZkZ5s+fj4MH\nD6KiogIff/wxWrVqBTMzM8yaNQtTp06V+KUaHByMGTNmwNDQEIcPH8bAgQPx7bffYty4cbC0tMTj\nx4/rbOMHgMOHD2PYsGGYOHEiDAwM0LVrV9y6dQve3t4AgJCQEKSkpMDS0hJjx47FypUrMWDAANH6\nvr6+SEpKgoWFBbp27Sp6/ptvvsGtW7egr6+PkSNHYty4cVJdprphwwYcPHgQenp6CAoKgr+/v8T6\n1bfF4XBEz40fPx7Lli3D5MmToaenh7FjxyInJwdqamo4fvw47ty5AxsbG5iYmCAoKAj5+fm1xlB1\nm1VNmzYNLi4usLa2xpAhQ2rE9qbteHh4YNeuXfj4449hYGAALy8vUf/UokWLcPjwYRgZGeGjjz6q\nsZ3NmzdDW1sbNjY28PT0xJQpUzBr1qw6Y6XLgps2DntbTxohhBBSC6XUQCIiIuDo6Ah7e3usXbu2\nxusHDhyAi4sLnJ2d0adPH1FbOiC8Pt3Z2Rlubm7o0aOHIsMmhBBShcJrIAKBAA4ODoiKigKXy4WH\nhwdCQkLg5OQkWubq1avo3Lkz9PX1ERERgeDgYFy7dg0A0LFjR9y8eRNGRkaKDJsQQkg1Cq+BxMbG\nws7ODtbW1tDU1IS/vz/Cw8MllunVqxf09fUBAD179sTTp08lXqdWN0IIUT6FJxA+ny9x7TyPx6vz\nEkxAOGhp2LBhojKHw8GgQYPg7u6OHTt2NGqshBBC6qah6B1Kc1XFuXPn8Ntvv+Hy5cui5y5fvgwL\nCwtkZWXB29sbjo6OonmVZNkH
}
],
"prompt_number": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see in Figure below that the covariance function corresponding to the spectral density S2 significantly differs from the one estimated directly from data. It can be seen in Figure above that the covariance corresponding to S1 agrees much better with the estimated covariance function."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"R2 = S2.tocovdata(nr=1)\n",
"R2.plot('.')\n",
"Rest.plot()\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEXCAYAAACDChKsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNX/P/DXsLiA7JtsggoKKCAKmilFClqW5B5q5oLK\nx1LLyq99sgXtZ6nlx0z7pLmFmoT1SbFSxA0xUzFFUdEUFYERXFgUhViG8/uDGHZlhmEGmNfz8eAR\n5845577vjM2be+6550qEEAJEREQK0tF0AERE1DIxgRARkVKYQIiISClMIEREpBQmECIiUgoTCBER\nKYUJhEiFevbsifj4eE2H0awYGRkhNTVV02FQE2ACIZUJCAiAubk5iouLFWqno6OD69evK73f4uJi\nhIeHo1u3bujQoQM6d+6M0NBQ3Lx5U+k+lXXhwgU888wzat9vfaZMmYK2bdvCyMhI/vPjjz822f4C\nAgKwcePGatvy8/Ph7OzcZPskzWECIZVITU1FQkICrK2tsXv3boXbN+Z+1jFjxuDXX39FZGQkHjx4\ngHPnzsHX1xcHDx5Uuk9FlZaWqm1fipBIJFiwYAHy8/PlP2PHjm3S/ZH2YAIhldiyZQsCAwMxadIk\nREREVHut5l+l3333Hfz9/QFA/te6t7d3tb+O169fD1dXV1hYWODll19GZmZmnfs9cOAADhw4gOjo\naPTp0wc6OjowNjbGrFmzMG3aNADArVu3EBwcDAsLC7i6umLDhg3y7QYGBsjNzZX3l5iYCCsrK8hk\nMly7dg2DBg2CpaUlrKys8Oqrr+L+/fvyus7Ozli+fDm8vLxgZGQEmUwGZ2dnHDp0CACQkJCA/v37\nw8zMDHZ2dpgzZw5KSkrk7XV0dLBu3Tp069YNZmZmmD17drVjW79+PTw8PGBsbIwePXogMTFRHvfo\n0aNhbW2NLl26YPXq1Q39mOSmTJmCDz/8UF6Oi4uDo6NjtWNbsWIF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1P4sq9LV1cW4ceOwcOFCPHz4EDdv3sTKlSurfRbUsjCBUKNs2bIF06ZNg4OD\nA6ytrWFtbQ0bGxvMnj0b27dvR1lZGebNm4c2bdrAxsYGU6dOxauvvlrtL9Xw8HBMnjwZZmZm+Omn\nnzB48GB88sknGD16NOzs7HDjxo16x/gB4KeffsKwYcPwyiuvwNTUFJ6enjhz5gyCgoIAAJGRkUhN\nTYWdnR1GjRqFxYsXY9CgQfL2wcHBSElJga2tLTw9PeXbP/74Y5w5cwYmJiYYPnw4Ro8erdA01S++\n+ALbt2+HsbExZs6ciZCQkGrta/YlkUjk28aMGYOFCxdiwoQJMDY2xqhRo5CbmwsdHR38+uuvOHv2\nLLp06QIrKyvMnDkTDx48qDOGqn1WNWnSJHh7e8PZ2RnPP/98rdge14+fnx82b96MefPmwdTUFAEB\nAfLrU2+++SZ++uknmJub46233qrVz+rVq2FoaIguXbrA398fEydOxNSpU+uNldOCmzeJeNKVNCIi\nojpo5AwkJiYGbm5ucHV1xbJly2q9/v3338Pb2xteXl4YMGCAfCwdKJ+f7uXlBR8fH/Tt21edYRMR\nURVqPwORyWTo3r07Dhw4AHt7e/j5+SEyMhLu7u7yOsePH4eHhwdMTEwQExOD8PBwnDhxAgDQuXNn\nnD59Gubm5uoMm4iIalD7GUhCQgJcXFzg7OwMfX19hISEIDo6ulqd/v37w8TEBADQr18/ZGRkVHud\no25ERJqn9gQilUqrzZ13cHCodwomUH7T0rBhw+RliUSCwMBA+Pr6Yv369U0aKxER1U9P3TtUZFbF\n4cOHsWnTJhw7dky+7dixY7C1
}
],
"prompt_number": 11
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Section 2.2.2 Transformed Gaussian models\n",
"-------------------------------------------\n",
"We begin with computing skewness and kurtosis for the data set xx and compare it with the second order wave approximation proposed by Winterstein:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import wafo.stats as ws\n",
"rho3 = ws.skew(xx[:, 1])\n",
"rho4 = ws.kurtosis(xx[:, 1])\n",
"\n",
"sk, ku = S1.stats_nl(moments='sk')"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 13
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"Comparisons of 3 transformations"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"import wafo.transform.models as wtm\n",
"gh = wtm.TrHermite(mean=me, sigma=sa, skew=sk, kurt=ku).trdata()\n",
"g = wtm.TrLinear(mean=me, sigma=sa).trdata() # Linear transformation \n",
"glc, gemp = lc.trdata(mean=me, sigma=sa)\n",
"\n",
"glc.plot('b-') #! Transf. estimated from level-crossings\n",
"gh.plot('b-.') #! Hermite Transf. estimated from moments\n",
"g.plot('r')\n",
"grid('on')\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAETCAYAAADecgZGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdUFPcWwPEvIAoGxYIdFbtgARQ0GguaEBVj19h7S7Em\nsUaN3WjUWGM0FiyxxF6e8mygxl7AFhNNFEUJ9gJYaPP+mCfGUFx1l9mdvZ9zch7DzrL3vkkuw51f\nsVEURUEIIYRVsdU6ACGEEBlPir8QQlghKf5CCGGFpPgLIYQVkuIvhBBWSIq/EEJYISn+QhjBzZs3\nqVWrFtmzZ2fQoEFahyPEK2XSOgAh3paTkxM2NjYAxMbG4uDggJ2dHQALFiygbdu2Jo9hwYIF5M2b\nl0ePHpn8s4QwBin+wuLFxMQkf12sWDEWLVpE3bp1U5yXkJBApkym+Vf+6tWruLu7v9F7TRmXEGmR\nto/QrZCQEFxdXZkyZQoFChSge/fuPHjwgI8++oi8efOSK1cuGjVqxI0bN5Lf4+fnx6hRo6hRowbZ\ns2enXr163L17F4CnT5/SoUMHXFxcyJkzJ1WqVOHWrVt06dKFZcuWMWXKFLJly8bevXuJi4tjwIAB\nFCpUiEKFCjFw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ldgIGzdCkuWqC0hayCregohLMqUYbXpMHc/x6s4UX39JSo750/1\nvCxZ4NAhKF065Wt//w2tWsGxY+rS/R9/nObwf90yi55/WqTnL4R4LjE6mqUf5qHu78/YMqwF/Qav\ne+2fER0NkybB/PnqLo1ffQWO
}
],
"prompt_number": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Test Gaussianity of a stochastic process\n",
"------------------------------------------\n",
"TESTGAUSSIAN simulates e(g(u)-u) = int (g(u)-u)^2 du for Gaussian processes given the spectral density, S. The result is plotted if test0 is given. This is useful for testing if the process X(t) is Gaussian.\n",
"If 95% of TEST1 is less than TEST0 then X(t) is not Gaussian at a 5% level.\n",
"\n",
"As we see from the figure below: none of the simulated values of test1 is above 1.00. Thus the data significantly departs from a Gaussian distribution. "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"test0 = glc.dist2gauss()\n",
"# the following test takes time\n",
"N = len(xx)\n",
"test1 = S1.testgaussian(ns=N, cases=50, test0=test0)\n",
"is_gaussian = sum(test1 > test0) > 5 \n",
"print(is_gaussian)\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"False\n"
]
},
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEKCAYAAAASByJ7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtUlGXiB/DvKBiVZpbJCkOhQFwEGRJhPWqMFxwvQZnu\nhpbHQ6aspWR77PJTO0KZlzx79pDunrWt7GK5tl0WE528MZIWFwmjTbfIxAZWPOJl0zTD4fn9IY6O\nzAzMMO+87zvv93OO58zlmZmHx3fe7/s+l3d0QggBIiLSvG5yV4CIiJSBgUBERAAYCERE1IaBQERE\nABgIRETUhoFAREQAJA6ERx99FKGhoUhKSnJbrqqqCkFBQfjoo4+krA4REbkhaSDk5ubCbDa7LWOz\n2fDss89i/Pjx4JII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L6eEiIzc81ISLyDbddRmfPnkVxcTH27duHo0ePAgDu\nuusujBgxAvfffz969uzpn0oqsMvI2RhCVNQiFBWN5xgCESkCVyr7EX9TgIiUzOeB8Kc//and9Yx6\n9+6NIUOGwGAweFdLDyk1EIiIlMzngTB9+nTs378fWVlZEEKgpKQESUlJOHr0KKZOnYpnn322y5Xu\nsJIMBCIij/k8EEaOHIlt27bZxwvOnTuHiRMnwmw2Y8iQITh06FDXatyZSjIQiIg85rNpp1ecOHEC\nPXr0sN8PDg7G8ePHcdNNNyEkJMS7WhIRkeJ0uFL54YcfRnp6Oh544AEIIfDJJ59g+vTp+Pnnn5GQ\nkOCPOhKRSvHyLurSqVlGVVVV
}
],
"prompt_number": 15
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Normalplot of data xx\n",
"------------------------\n",
"indicates that the underlying distribution has a \"heavy\" upper tail and a \"light\" lower tail."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"import pylab\n",
"ws.probplot(ts.data.ravel(), dist='norm', plot=pylab)\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEWCAYAAACNJFuYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xtcz/f///Hbu5OOSCo6EAqlkMOyA3JIThl2IGxmZnbA\nZ4fvZzbsK9vYxw6ffdnwM59tjDnsZA5htpF8ZtakzRBCUQk5pKN0eP3+eNW73t7vlNT73eFxvVxc\n1vv1fr3fPbLtfe951iiKoiCEEEKUY2bqAoQQQtQ9Eg5CCCH0SDgIIYTQI+EghBBCj4SDEEIIPRIO\nQggh9Eg4iEbHzMyMs2fPVuu1Xl5e/PLLLwaf279/P507d9a5d8+ePQAsWrSIadOmVet73o2oqCg8\nPT1r/fuIhk/CQdQLXl5e2Nra4uDgQKtWrZgyZQo5OTlGr0Oj0aDRaAw+17dvX06c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42sFQVdKtJIQQNaB0jOHUqTRycgACS565vRspgdWrX6hya+GP1D+Ytm0aLnYu/P7M\n73Ro0aHmizdAupWEEOIeREZGM2vWEs6eVQBHoBVqC2FNyddl3UitWr3Mf/4zpkrBkJWfxby989h0\ndBMfDPmAiQETa+z0SxmQFkKIWqIbCpaAT8kz5bfAWAuEY2lZRECAM2+9Na5KwbDlxBZm7pzJ4PaD\nOfbCMZxsnWr+B6iEhIMQQtyFyMhopk5dyKVLdpSFgqGP0n6Udik98EAEUVERlb53amYqM3fO5Ojl\no6wZvYYB7QbUXOF3SQakhRCi
}
],
"prompt_number": 16
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Section 2.2.3 Spectral densities of sea data\n",
"-----------------------------------------------\n",
"Example 2: Different forms of spectra"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import wafo.spectrum.models as wsm\n",
"clf()\n",
"Hm0 = 7; Tp = 11;\n",
"spec = wsm.Jonswap(Hm0=Hm0, Tp=Tp).tospecdata()\n",
"spec.plot()\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEXCAYAAABYsbiOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVOX+B/DPsCSLLAqICibmioqIKLgzpriV6FVL0RKX\nsq65tS/aVbPFtNXsdssFLH6lNyv1dpXriporKJlLghsqgiQuIDsMz++PExMgywBz5pxhPu/Xixcz\nc84853s4Ot95lvM8GiGEABERUSWslA6AiIjUi0mCiIiqxCRBRERVYpIgIqIqMUkQEVGVmCSIiKhK\nTBJEZsbHxwe7d+82aN+oqCgMGDBA1nj+/ve/4+2335b1GKQcJgkyiFarxdq1a5UOw6jWrl0LX19f\nODs7o3nz5njkkUeQnZ0t2/GSk5NhZWWFkpKSepWj0Wig0WiMFFX9ffHFF1i4cCEAIDY2Fq1atVI4\nIjImG6UDIPOgt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f43cm44uLicOLECUyYMEHpUKiWFEkS06ZNQ0xM\nzH2vX7t2DTt37iw3eoaU9eqrr2LYsGFYvny56psJjHlXeEO7w1xJERERCA0NxSeffAJHR0elw6Fa\nUqy5KTk5GaNGjcKpU6f0rz322GN48803MXr0aBw/fhxNmzZVIjQiIvqTajqut2zZAm9vb3Tr1k3p\nUIiI6E+qmOAvNzcX7777Lnbu3Kl/raoKDpsAiIjqpi4NR6qoSVy8eBHJycnw9/dHmzZtkJKSgsDA\nQPzxxx+V7l86Lrsh/ixatEjx
}
],
"prompt_number": 17
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Directional spectrum and Encountered directional spectrum\n",
"=========================================================\n",
"Directional spectrum\n",
"---------------------"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"D = wsm.Spreading('cos2s')\n",
"Sd = D.tospecdata2d(spec)\n",
"Sd.plot()\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEXCAYAAACtTzM+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVXX+x/HXZZF9EwMFRdxXENTEtTBzTa0hM00Nt8Zm\nWrSafk2TpZba4thiTU22aJmVWpM5lmSapI6aqbjvJaEiKC5sgnAv5/cHeJNAvaCXzffz8fDx4N57\n7vl+vpyH5835nnO+x2QYhoGIiNzwHCq7ABERqRoUCCIiAigQRESkiAJBREQABYKIiBRRIIiICKBA\nkArwl7/8henTp1dIW23btmXt2rV2bSMxMREHBwcKCgrs2o5IRVMgyDUJDQ3F3d0db29v/Pz86Nat\nG++++y6X3t7yzjvvMHny5Ove9ujRo3n22WeLvbd7925uueWW695WWaxfv56uXbvi6+uLv78/3bt3\nZ8uWLXZtMzQ0lB9++MGubUjNp0CQa2IymVi+fDkZGRkkJSXx97//nZdffplx48bZ9H2z2WznCitW\nRkYGAwcOZOLEi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tm2ZM2dOZZUiIiKAyTAMozIaTklJ\nISUlhYiICLKysujQoQNLly6lVatWvxdnMlFJ5YmIVFvl3XdW2hFC3bp1iYiIAMDT05NWrVqRnJxc\nWeWIiNzwnCq7AIDExEQSEhKIiooq8dnUqVOtP0dHRxMdHV1xhYmIVAPx8fHEx8df83oqbcjooqys\nLKKjo5k8eTJ33XVXsc80ZCQi
}
],
"prompt_number": 18
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Encountered directional spectrum\n",
"--------------------------------- "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#clf()\n",
"#Se = spec2spec(Sd,'encdir',0,10);\n",
"#plotspec(Se), hold on\n",
"#plotspec(Sd,1,'--'), hold off\n",
"##!wafostamp('','(ER)')\n",
"#disp('Block = 17'),pause(pstate)\n",
"#\n",
"##!#! Frequency spectra\n",
"#clf\n",
"#Sd1 =spec2spec(Sd,'freq');\n",
"#Sd2 = spec2spec(Se,'enc');\n",
"#plotspec(spec), hold on\n",
"#plotspec(Sd1,1,'.'),\n",
"#plotspec(Sd2),\n",
"##!wafostamp('','(ER)')\n",
"#hold off\n",
"#disp('Block = 18'),pause(pstate)\n",
"#\n",
"##!#! Wave number spectrum\n",
"#clf\n",
"#Sk = spec2spec(spec,'k1d')\n",
"#Skd = spec2spec(Sd,'k1d')\n",
"#plotspec(Sk), hold on\n",
"#plotspec(Skd,1,'--'), hold off\n",
"##!wafostamp('','(ER)')\n",
"#disp('Block = 19'),pause(pstate)\n",
"#\n",
"##!#! Effect of waterdepth on spectrum\n",
"#clf\n",
"#plotspec(spec,1,'--'), hold on\n",
"#S20 = spec;\n",
"#S20.S = S20.S.*phi1(S20.w,20);\n",
"#S20.h = 20;\n",
"#plotspec(S20), hold off\n",
"##!wafostamp('','(ER)')\n",
"#disp('Block = 20'),pause(pstate)\n",
"#\n",
"##!#! Section 2.3 Simulation of transformed Gaussian process\n",
"##!#! Example 3: Simulation of random sea \n",
"##! The reconstruct function replaces the spurious points of seasurface by\n",
"##! simulated data on the basis of the remaining data and a transformed Gaussian\n",
"##! process. As noted previously one must be careful using the criteria \n",
"##! for finding spurious points when reconstructing a dataset, because\n",
"##! these criteria might remove the highest and steepest waves as we can see\n",
"##! in this plot where the spurious points is indicated with a '+' sign:\n",
"##!\n",
"#clf\n",
"#[y, grec] = reconstruct(xx,inds);\n",
"#waveplot(y,'-',xx(inds,:),'+',1,1)\n",
"#axis([0 inf -inf inf])\n",
"##!wafostamp('','(ER)')\n",
"#disp('Block = 21'),pause(pstate)\n",
"#\n",
"##! Compare transformation (grec) from reconstructed (y) \n",
"##! with original (glc) from (xx)\n",
"#clf\n",
"#trplot(g), hold on\n",
"#plot(gemp(:,1),gemp(:,2))\n",
"#plot(glc(:,1),glc(:,2),'-.')\n",
"#plot(grec(:,1),grec(:,2)), hold off \n",
"#disp('Block = 22'),pause(pstate)\n",
"#\n",
"##!#!\n",
"#clf\n",
"#L = 200;\n",
"#x = dat2gaus(y,grec);\n",
"#Sx = dat2spec(x,L);\n",
"#disp('Block = 23'),pause(pstate)\n",
"# \n",
"##!#!\n",
"#clf\n",
"#dt = spec2dt(Sx)\n",
"#Ny = fix(2*60/dt) #! = 2 minutes\n",
"#Sx.tr = grec;\n",
"#ysim = spec2sdat(Sx,Ny);\n",
"#waveplot(ysim,'-')\n",
"##!wafostamp('','(CR)')\n",
"#disp('Block = 24'),pause(pstate)\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Estimated spectrum compared to Torsethaugen spectrum\n",
"-------------------------------------------------------"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clf()\n",
"fp = 1.1;dw = 0.01\n",
"H0 = S1.characteristic('Hm0')[0]\n",
"St = wsm.Torsethaugen(Hm0=H0,Tp=2*pi/fp).tospecdata(np.arange(0,5+dw/2,dw)) \n",
"S1.plot()\n",
"St.plot('-.')\n",
"axis([0, 6, 0, 0.4])\n",
"show()\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEXCAYAAAC6baP3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVOX+wPHPsAiyCSIqMiQohmguKG6liaViVrhmqKW5\nlC1W9mv1Vje1xavd6rrUvVqa2WLcriVWSmSKmam45q6gooiiYKKAyMBwfn+cGEG2GRg4MHzfrxev\nmHOe55zvGWy+c57nPM+jUxRFQQghhDCTndYBCCGEqF8kcQghhLCIJA4hhBAWkcQhhBDCIpI4hBBC\nWEQShxBCCItI4hB1Vnh4OMuWLdM6jAYpPj4ef39/s8vXxt/K3d2d5OTkGj2HMI8kDgGAm5sb7u7u\nuLu7Y2dnh4uLi+n1qlWravz8s2bN4uGHHy6xTafTodPpavzcNSkzM5PJkyfj6+uLh4cHwcHBzJs3\nr0bPWdZ7WdNq42+VlZVFQEAAAI888givv/56jZ5PlM9B6wBE3ZCdnW36PTAwkGXLlnHXXXdZdIyC\nggIcHOSfVHHPPfccubm5HD16lCZNmnDs2DEOHjyoaUxFY37re1IW2pE7DlGhvLw8ZsyYgZ+fH35+\nfjz33HMYDAZAbc7Q6/XMnz8fX19fpkyZwqVLl7jvvvvw8vLC29ubO++80/RBde7cOUaNGkXz5s1p\n06YNixYtAiA2Npa5c+cSHR2Nu7s7oaGhpvMnJyfTt29fPDw8iIiI4NKlS6Z9DzzwAL6+vnh6etK/\nf38OHz5s2ndz08mKFSvo16+f6XVcXBzBwcF4enry1FNP0b9//xLlly9fTocOHWjatClDhgzhzJkz\npn12dnYsWbKEW2+9FS8vL6ZPn17u+7dr1y7Gjh1LkyZNAAgODmbUqFEljrVo0SLatm2Lj48PL730\nEsUnc6gojkOHDjFo0CC8vb1p2bIlc+fO5aeffirzvQwPD+e1117jjjvuwNXVlZMnT/Lpp5/SoUMH\nPDw8aNu2LUuXLi33Om72888/0759ezw9PXn66adRFMXsuCt6/5KSkujfvz+enp74+PgQFRVVot6J\nEydYunQpX331FfPnz8fd3Z3IyEj++c9/Mnr06BIxPvPMM8yYMcPsaxIWUIS4SUBAgPLLL78oiqIo\nr7/+utKnTx8lPT1dSU9PV26//Xbl9ddfVxRFUTZt2qQ4ODgor7zyimIwGJTc3FzllVdeUR5//HGl\noKBAKSgoUH777TdFURTFaDQq3bp1U958800lPz9fOXnypNKmTRvlp59+UhRFUWbNmqU8/PDDJeLo\n37+/0rZtWyUxMVHJzc1VwsPDlVdeecW0/9NPP1Wys7MVg8GgzJgxQ+natatpX3h4uLJs2bISZfv2\n7asoiqKkp6crHh4eynfffacYjUZlwYIFiqOjo6n8mjVrlKCgIOXo0aOK0WhU3nrrLeX22283HUun\n0yn333+/cuXKFeXMmTOKj4+PEhsbW+Z7OXXqVKVjx47Kp59+qhw/frzUfp1Op9x1113K5cuXlTNn\nzii33nqr8sknn1Qax9WrV5WWLVsq77//vpKXl6dkZWUpO3bsqPC9bN26tXL48GHFaDQq+fn5yo8/\n/qicPHlSURRF2bx5s+Li4qLs2bPH9LfV6/VlXlN6erri7u6urF69WikoKFA++OADxcHBoVrvX9G/\ng6ioKOWdd95RFEVR8vLylK1bt5aod+LECUVRFOWRRx4x/TtUFEU5f/684urqqmRmZiqKoij5+flK\n8+bNTdcjrEsShyileOJo27atsn79etO+n376SQkICFAURf1wadSokZKXl2fa//e//10ZNmyYkpSU\nVOKY27dvV2655ZYS29555x1l0qRJiqIoyhtvvKE89NBDJfaHh4crb7/9tun1Rx99pAwZMqTMmC9f\nvqzodDrl6tWrprrlJY7PPvusxAeZoiiKv7+/qfyQIUNK1DUajYqLi4ty5swZRVHUD7DiH2hjxoxR\n/vGPf5QZV25urvLOO+8o3bt3VxwdHZWgoKAS76dOpzN9aBZd4913311hHKdPn1a++uorpVu3bmWe\ns7z38o033iizfJHhw4crCxYsUBSl4sTx2WefKX369CmxTa/XV+v9mzdvnqIoijJhwgTlscceU86e\nPVvqvDcnjtdee63E/iFDhigff/yxo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OsR3331HQUEBCxcutNr7980335iSuKen\nJzqdrsxE2KJFi1IJpXHjxowaNYpx48bRq1evUndFwnokcYgKvfbaa4SFhdG5c2c6d+5MWFgYr732\nmmn/zd/8EhMTGTRoEO7u7tx+++2mJ5bs7Oz44Ycf2LdvH23atMHHx4fHHnuMq1evAuoTUgDe3t6E\nhYWVefziYwUmTJhA69at8fPz47bbbqNPnz4lyj733HM0atSIFi1aMGnSJB566CHT/mbNmvHNN9/w\n0ksv0axZM44cOUJYWBhOTk4ADB8+nJdffpmoqCiaNGlCp06d+Omnn8q95orGMNjZ2TFp0iR8fHzw\n8/Pjl19+4ccff8TFxcVUZtiwYXTv3p3Q0FDuu+8+Jk+eXGkcbm5u/Pzzz3z//ff4+vpy6623Eh8f\nb/Z76e7uzsKFCxkzZgxNmzZl1apVDBs2rNR1lcXb25tvvvmGV155hWbNmpGUlETfvn1N+6vz/u3a\ntYvevXvj7u7OsGHDWLhwoWnsRvF6U6ZM4fDhw3h5eTFy5EjT9okTJ3Lw4EFppqphOsWce1MhbFhh\nYSH+/v589dVX9O/fv1bPbWdnR1JSksX9FaJsKSkptG/fngsXLuDm5qZ1ODZLszuO2NhY2rdvT7t2\n7SocSbtz504cHBxYvXq1xXWFKE9cXByZmZnk5eXxzjvvAFS7D0Noq7CwkPfee4+xY8dK0qhhmgzz\nNRqNTJ8+nQ0bNuDn50ePHj2I
}
],
"prompt_number": 19
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Transformed Gaussian model compared to Gaussian model\n",
"-------------------------------------------------------\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"dt = St.sampling_period()\n",
"va, sk, ku = St.stats_nl(moments='vsk' )\n",
"#sa = sqrt(va)\n",
"gh = wtm.TrHermite(mean=me, sigma=sa, skew=sk, kurt=ku, ysigma=sa)\n",
" \n",
"ysim_t = St.sim(ns=240, dt=0.5)\n",
"xsim_t = ysim_t.copy()\n",
"xsim_t[:,1] = gh.gauss2dat(ysim_t[:,1])\n",
"\n",
"ts_y = wo.mat2timeseries(ysim_t)\n",
"ts_x = wo.mat2timeseries(xsim_t)\n",
"ts_y.plot_wave(sym1='r.', ts=ts_x, sym2='b', sigma=sa, nsub=5, nfig=1)\n",
"show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD9CAYAAAC1DKAUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXl8Tcf7xz9BYqnIImSXyCJBFlGxk6QScS1BUepblCL8\nUFTRPYm2SbRUKa1SWylaOxVrJfZQu6K2JiSRIJslkfV+fn+ciERutrvnOu/X67ySc+6cmWfOnDPP\nzDPPzOiRJEREREREXjlqaVoAERERERHNICoAERERkVcUUQGIiIiIvKKICkBERETkFUVUACIiIiKv\nKKICEBEREXlFUVgBjBkzBubm5nB3d5f5e0xMDIyMjODl5QUvLy989dVXiiYpIiIiIqIE6igawejR\nozFlyhSMHDmy3DA+Pj7YuXOnokmJiIiIiCgRhXsA3bp1g4mJSYVhxLlmIiIiItqHyscA9PT0cOLE\nCXh6eqJ37964evWqqpMUEREREakCCpuAKqNt27ZISEhAgwYNsGfPHgwYMAA3btwoE05PT0/VooiI\niIjoJPJaWVTeAzA0NESDBg0AABKJBPn5+UhPT5cZlqTOHiEhIRqXQcybmD8xf7p3KILKFcD9+/eL\nhTx9+jRIwtTUVNXJioiIiIhUgsImIAcHB9y5cwckYWtri7CwMOTn5wMAgoODsXnzZnzxxRd4+vQp\n6tSpgx9//FFhoUVEREREFEdhBbBmzRo0bNgQI0eOxOXLl8v83rx5c3To0AFRUVE4deoUpk6dilGj\nRimabI3D19dX0yKoDF3OGyDmr6aj6/lTBD0qakQCEB8fj379+slUABMmTICfnx+GDh0KAHB1dcXh\nw4dhbm5eWhA9PYXtWTWFhw+BT7odRW5mNn70+BkN/1gJGBtrWiwREZEaiCJ1p8q9gJKSkmBra1t8\nbmNjg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VatWsgWp4Qpg9WrB\nLJAAa7lawxUikTAMn9OrwTU+uqPZj0YqJcPCBO+mu3eplMrtbofB9MR5jsYK5g4apjxhlUhhoeCN\nM2gQWVCgaWnIkBBBGeXnqz/dQYPkv/+/9kP5AeaxMR4y0Pw8t29Xfx6qw/bWn9AKiWyKFPa2OMvP\nPyd37CAT/d7hJbjxU8sVdGxeQCcn8tNPycuDQtTeM9BqL6Dg4GBuLGHo1cWJYLt2kebm5LVu4xRq\nDZdLRgalg4dw/Ls59PcX3Cw1gVRKzppFurmRyclKjFgi4RO8xgHG0ezWKZ8PHyoxbiUxYwbZtavg\n+qgNFBSQ/tZX+IXdKrVVNreGfkLTOpm84ztS/vSKzGHZr3flmp+esmNH0ua1NIbZrWCi3zta0yvI\nzSWnTyeb1UvhUXShtJ13ueNZUqkwie/DDwVX4CRYKr8RWAFa7QXUt29fHj9+vPi8R48ePHPmTFlB\naqgCOHZMmMUbG0uld/VfJj9fGHz73/+EFqk6kUrJKa0P8vWG/zK1x1tKV3AcMoSFaRn8+GPBxPDP\nP8qLXlG+/550dX3hzqktJHV8k6ZIFSocFVc22dlkO8Nr/A7TFKvcZHwj519/j8H4icZI50DrWO7b\np/73uyTx8WSHDsLcjLT/Mqv1TUt7VXNwXwkoUncqtBZQVbdxpBxrAWn7YnAv56FjxxInmzapPP3f\nflN5EuVi9hcAkz+UH3GJ5+bmpvzoFaVxY01LIIutsAaEZ6eGbVXPAPhAGemV+UZWAJiIbUnAtkD5\no1U2jf8s+qea3zT371fZCr/KXAxO5V5AuroWUHw8aWND/vab+tNOTSVdXMiFC1WfVmEhOW4c2bkz\n+SjgTbW1bo4fJy0NHvJdrGQc7NQ++C2VCvZu+3r3eBWuau3SV5mMDD4MGkNTk0Levq26ZH74QZjo\n9jRRRT3cl3oFUqmwNMpoi91s
}
],
"prompt_number": 20
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
11 years ago
}