"cells": [
{
"cell_type": "markdown",
- "metadata": {
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"source": [
"\n",
"\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"library(talweg)\n",
},
{
"cell_type": "markdown",
- "metadata": {
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"source": [
"\n",
"\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
- "reload(\"../pkg\")\n",
"p_nn = computeForecast(data, indices_ch, \"Neighbors\", \"Neighbors\", horizon=H)\n",
- "p_nn2 = computeForecast(data, indices_ch, \"Neighbors2\", \"Neighbors\", horizon=H)\n",
+ "p_nn2 = computeForecast(data, indices_ch, \"Neighbors2\", \"Zero\", horizon=H)\n",
"p_az = computeForecast(data, indices_ch, \"Average\", \"Zero\", horizon=H)\n",
"p_pz = computeForecast(data, indices_ch, \"Persistence\", \"Zero\", horizon=H, same_day=TRUE)"
]
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
- "outputs": [],
- "source": [
- "p_nn2$getParams(5)$weights"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"e_nn = computeError(data, p_nn, H)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"options(repr.plot.width=9, repr.plot.height=4)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
- "#plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
- "#plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
+ "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
+ "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
"\n",
- "plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
+ "# Generally too few neighbors:\n",
+ "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
"#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
]
},
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "f_np2"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n",
},
{
"cell_type": "markdown",
- "metadata": {
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"source": [
"\n",
"\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"p_nn = computeForecast(data, indices_ep, \"Neighbors\", \"Neighbors\", horizon=H)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"e_nn = computeError(data, p_nn, H)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"options(repr.plot.width=9, repr.plot.height=4)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
"plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
"plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
"\n",
- "plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
- "plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
+ "# Generally too few neighbors:\n",
+ "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
+ "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
]
},
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n",
},
{
"cell_type": "markdown",
- "metadata": {
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"source": [
"\n",
"\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"p_nn = computeForecast(data, indices_np, \"Neighbors\", \"Neighbors\", horizon=H)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"e_nn = computeError(data, p_nn, H)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"options(repr.plot.width=9, repr.plot.height=4)\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
"plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
"plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
"\n",
- "plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
- "plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
+ "# Generally too few neighbors:\n",
+ "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
+ "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
]
},
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"par(mfrow=c(1,2))\n",
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": false,
- "deletable": true,
- "editable": true
- },
+ "metadata": {},
"outputs": [],
"source": [
"# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n",
]
}
],
- "metadata": {
- "kernelspec": {
- "display_name": "R",
- "language": "R",
- "name": "ir"
- },
- "language_info": {
- "codemirror_mode": "r",
- "file_extension": ".r",
- "mimetype": "text/x-r-source",
- "name": "R",
- "pygments_lexer": "r",
- "version": "3.3.3"
- }
- },
+ "metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}