mirror of
https://github.com/Steffo99/unisteffo.git
synced 2025-03-13 12:17:36 +00:00
0.8.6
This commit is contained in:
parent
3fd64d4320
commit
fc513e8376
27 changed files with 412 additions and 121 deletions
1
docs/bundle.3fda8.esm.js.LICENSE.txt
generated
1
docs/bundle.3fda8.esm.js.LICENSE.txt
generated
|
@ -1 +0,0 @@
|
|||
/*! For license information please see bundle.3fda8.esm.js.LICENSE.txt */
|
6
docs/bundle.cdee3.js → docs/bundle.44838.js
generated
6
docs/bundle.cdee3.js → docs/bundle.44838.js
generated
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
docs/bundle.b7974.esm.js.LICENSE.txt
generated
Normal file
1
docs/bundle.b7974.esm.js.LICENSE.txt
generated
Normal file
|
@ -0,0 +1 @@
|
|||
/*! For license information please see bundle.b7974.esm.js.LICENSE.txt */
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.3fda8.esm.js","sourceRoot":""}
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.b7974.esm.js","sourceRoot":""}
|
2
docs/index.html
generated
2
docs/index.html
generated
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html lang="it"><head><meta charset="utf-8"><title>appuntiweb</title><meta content="width=device-width,initial-scale=1" name="viewport"><link href="/favicon.ico" rel="icon" type="image/x-icon"><link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"><style>body{background-color:#0d193b}</style><link rel="manifest" href="/manifest.json"><link href="/bundle.724d1.css" rel="preload" as="style"><noscript><link rel="stylesheet" href="/bundle.724d1.css"></noscript><script>function $loadcss(u,m,l){(l=document.createElement('link')).rel='stylesheet';l.href=u;document.head.appendChild(l)}$loadcss("/bundle.724d1.css")</script></head><body><script type="__PREACT_CLI_DATA__">{"preRenderData":{"url":"/"}}</script><script nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" src="/bundle.3fda8.esm.js" type="module"></script><script nomodule="" src="/polyfills.8f3b5.js"></script><script nomodule="" defer="defer" src="/bundle.cdee3.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="it"><head><meta charset="utf-8"><title>appuntiweb</title><meta content="width=device-width,initial-scale=1" name="viewport"><link href="/favicon.ico" rel="icon" type="image/x-icon"><link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"><style>body{background-color:#0d193b}</style><link rel="manifest" href="/manifest.json"><link href="/bundle.724d1.css" rel="preload" as="style"><noscript><link rel="stylesheet" href="/bundle.724d1.css"></noscript><script>function $loadcss(u,m,l){(l=document.createElement('link')).rel='stylesheet';l.href=u;document.head.appendChild(l)}$loadcss("/bundle.724d1.css")</script></head><body><script type="__PREACT_CLI_DATA__">{"preRenderData":{"url":"/"}}</script><script nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" src="/bundle.b7974.esm.js" type="module"></script><script nomodule="" src="/polyfills.29a91.js"></script><script nomodule="" defer="defer" src="/bundle.44838.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"polyfills.b885f.esm.js","sourceRoot":""}
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"polyfills.37ed5.esm.js","sourceRoot":""}
|
2
docs/push-manifest.json
generated
2
docs/push-manifest.json
generated
|
@ -1 +1 @@
|
|||
{"/":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1}},"/AlgoritmiEStruttureDati":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-AlgoritmiEStruttureDati.chunk.e6f90.esm.js":{"type":"script","weight":0.9}},"/ApprendimentoSistemiArtificiali":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-ApprendimentoSistemiArtificiali.chunk.857ce.esm.js":{"type":"script","weight":0.9},"route-ApprendimentoSistemiArtificiali.chunk.55de3.css":{"type":"style","weight":0.9}},"/BasiDiDati":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-BasiDiDati.chunk.f1dc7.esm.js":{"type":"script","weight":0.9},"route-BasiDiDati.chunk.1d0a7.css":{"type":"style","weight":0.9}},"/CalcoloNumerico":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-CalcoloNumerico.chunk.3b3c9.esm.js":{"type":"script","weight":0.9},"route-CalcoloNumerico.chunk.782c4.css":{"type":"style","weight":0.9}},"/Fisica":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-Fisica.chunk.e2766.esm.js":{"type":"script","weight":0.9},"route-Fisica.chunk.ed9a8.css":{"type":"style","weight":0.9}},"/Home":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-Home.chunk.d3981.esm.js":{"type":"script","weight":0.9},"route-Home.chunk.b342d.css":{"type":"style","weight":0.9}},"/MingwInstall":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-MingwInstall.chunk.1eacd.esm.js":{"type":"script","weight":0.9}},"/NetLogo":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-NetLogo.chunk.18d97.esm.js":{"type":"script","weight":0.9},"route-NetLogo.chunk.1d0a7.css":{"type":"style","weight":0.9}},"/OttimizzazioneLineare":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-OttimizzazioneLineare.chunk.b7c6f.esm.js":{"type":"script","weight":0.9},"route-OttimizzazioneLineare.chunk.99830.css":{"type":"style","weight":0.9}},"/RipassoDiAlgebraLineare":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-RipassoDiAlgebraLineare.chunk.0ebef.esm.js":{"type":"script","weight":0.9},"route-RipassoDiAlgebraLineare.chunk.1d0a7.css":{"type":"style","weight":0.9}},"/Statistica":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-Statistica.chunk.68267.esm.js":{"type":"script","weight":0.9},"route-Statistica.chunk.9d494.css":{"type":"style","weight":0.9}},"/VlDiGeometria":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.3fda8.esm.js":{"type":"script","weight":1},"route-VlDiGeometria.chunk.56154.esm.js":{"type":"script","weight":0.9}}}
|
||||
{"/":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1}},"/AlgoritmiEStruttureDati":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-AlgoritmiEStruttureDati.chunk.e6f90.esm.js":{"type":"script","weight":0.9}},"/ApprendimentoSistemiArtificiali":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-ApprendimentoSistemiArtificiali.chunk.857ce.esm.js":{"type":"script","weight":0.9},"route-ApprendimentoSistemiArtificiali.chunk.55de3.css":{"type":"style","weight":0.9}},"/BasiDiDati":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-BasiDiDati.chunk.f1dc7.esm.js":{"type":"script","weight":0.9},"route-BasiDiDati.chunk.1d0a7.css":{"type":"style","weight":0.9}},"/CalcoloNumerico":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-CalcoloNumerico.chunk.09ebc.esm.js":{"type":"script","weight":0.9},"route-CalcoloNumerico.chunk.8f997.css":{"type":"style","weight":0.9}},"/Fisica":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-Fisica.chunk.e2766.esm.js":{"type":"script","weight":0.9},"route-Fisica.chunk.ed9a8.css":{"type":"style","weight":0.9}},"/Home":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-Home.chunk.d3981.esm.js":{"type":"script","weight":0.9},"route-Home.chunk.b342d.css":{"type":"style","weight":0.9}},"/MingwInstall":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-MingwInstall.chunk.1eacd.esm.js":{"type":"script","weight":0.9}},"/NetLogo":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-NetLogo.chunk.18d97.esm.js":{"type":"script","weight":0.9},"route-NetLogo.chunk.1d0a7.css":{"type":"style","weight":0.9}},"/OttimizzazioneLineare":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-OttimizzazioneLineare.chunk.b7c6f.esm.js":{"type":"script","weight":0.9},"route-OttimizzazioneLineare.chunk.99830.css":{"type":"style","weight":0.9}},"/RipassoDiAlgebraLineare":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-RipassoDiAlgebraLineare.chunk.0ebef.esm.js":{"type":"script","weight":0.9},"route-RipassoDiAlgebraLineare.chunk.1d0a7.css":{"type":"style","weight":0.9}},"/Statistica":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-Statistica.chunk.68267.esm.js":{"type":"script","weight":0.9},"route-Statistica.chunk.9d494.css":{"type":"style","weight":0.9}},"/VlDiGeometria":{"bundle.724d1.css":{"type":"style","weight":1},"bundle.b7974.esm.js":{"type":"script","weight":1},"route-VlDiGeometria.chunk.56154.esm.js":{"type":"script","weight":0.9}}}
|
186
docs/route-CalcoloNumerico.chunk.09ebc.esm.js
generated
Normal file
186
docs/route-CalcoloNumerico.chunk.09ebc.esm.js
generated
Normal file
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"route-CalcoloNumerico.chunk.3b3c9.esm.js","sourceRoot":""}
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"route-CalcoloNumerico.chunk.09ebc.esm.js","sourceRoot":""}
|
2
docs/route-CalcoloNumerico.chunk.3812b.js
generated
2
docs/route-CalcoloNumerico.chunk.3812b.js
generated
File diff suppressed because one or more lines are too long
1
docs/route-CalcoloNumerico.chunk.3812b.js.map
generated
1
docs/route-CalcoloNumerico.chunk.3812b.js.map
generated
File diff suppressed because one or more lines are too long
93
docs/route-CalcoloNumerico.chunk.3b3c9.esm.js
generated
93
docs/route-CalcoloNumerico.chunk.3b3c9.esm.js
generated
File diff suppressed because one or more lines are too long
1
docs/route-CalcoloNumerico.chunk.782c4.css
generated
1
docs/route-CalcoloNumerico.chunk.782c4.css
generated
|
@ -1 +0,0 @@
|
|||
.red__2y1B_{color:#ff7d7d}.orange__dD2kx{color:#ffbb7d}.yellow__OEpwl{color:#ffff7d}.lime__CVe41{color:#7dff7d}.cyan__26ZAg{color:#7dffff}.blue__LO7Xm{color:#7d7dff}.magenta__1Akee{color:#ff7dff}.example__2PzAa{color:#d3a1ff;padding:4px;border-radius:4px;margin:4px 0}.example__2PzAa,.example__2PzAa table{background-color:rgba(211,161,255,.05)}.example__2PzAa table{border-spacing:0;border:2px solid rgba(211,161,255,.1);border-collapse:collapse}.example__2PzAa table tbody td,.example__2PzAa table tbody th,.example__2PzAa table thead td,.example__2PzAa table thead th{padding:4px;border:1px solid rgba(211,161,255,.1)}.example__2PzAa table thead{background-color:rgba(211,161,255,.1);color:#fff}.menulist__2Cmnq{font-size:large}.menulist__2Cmnq small{font-size:small}
|
1
docs/route-CalcoloNumerico.chunk.8f997.css
generated
Normal file
1
docs/route-CalcoloNumerico.chunk.8f997.css
generated
Normal file
|
@ -0,0 +1 @@
|
|||
.menulist__2Cmnq{font-size:large}.menulist__2Cmnq small{font-size:small}.red__2y1B_{color:#ff7d7d}.orange__dD2kx{color:#ffbb7d}.yellow__OEpwl{color:#ffff7d}.lime__CVe41{color:#7dff7d}.cyan__26ZAg{color:#7dffff}.blue__LO7Xm{color:#7d7dff}.magenta__1Akee{color:#ff7dff}.example__2PzAa{color:#d3a1ff;padding:4px;border-radius:4px;margin:4px 0}.example__2PzAa,.example__2PzAa table{background-color:rgba(211,161,255,.05)}.example__2PzAa table{border-spacing:0;border:2px solid rgba(211,161,255,.1);border-collapse:collapse}.example__2PzAa table tbody td,.example__2PzAa table tbody th,.example__2PzAa table thead td,.example__2PzAa table thead th{padding:4px;border:1px solid rgba(211,161,255,.1)}.example__2PzAa table thead{background-color:rgba(211,161,255,.1);color:#fff}
|
2
docs/route-CalcoloNumerico.chunk.b3074.js
generated
Normal file
2
docs/route-CalcoloNumerico.chunk.b3074.js
generated
Normal file
File diff suppressed because one or more lines are too long
1
docs/route-CalcoloNumerico.chunk.b3074.js.map
generated
Normal file
1
docs/route-CalcoloNumerico.chunk.b3074.js.map
generated
Normal file
File diff suppressed because one or more lines are too long
2
docs/sw-esm.js
generated
2
docs/sw-esm.js
generated
File diff suppressed because one or more lines are too long
2
docs/sw.js
generated
2
docs/sw.js
generated
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "appuntiweb",
|
||||
"version": "0.8.4",
|
||||
"version": "0.8.6",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"scripts": {
|
||||
"start": "preact watch --template src/template.html",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
|||
import style from "./05_ApprossimazioneDatiSperimentali.less";
|
||||
import {Fragment} from "preact";
|
||||
import {Section, Panel, ILatex, BLatex, PLatex} from "bluelib";
|
||||
import Example from "../../components/Example";
|
||||
|
||||
const r = String.raw;
|
||||
|
||||
|
@ -13,11 +14,208 @@ export default function (props) {
|
|||
<p>
|
||||
Interpolare dati sperimentali non fornisce quasi mai un modello del fenomeno.
|
||||
</p>
|
||||
<p>
|
||||
Vogliamo costruire una <b>funzione di regressione</b> che, dati molti più dati del grado della funzione, minimizzi il quadrato della distanza tra i punti sperimentali e i punti della funzione di regressione.
|
||||
</p>
|
||||
<p>
|
||||
Denominiamo:
|
||||
</p>
|
||||
<ul>
|
||||
<li><ILatex>{r`{\color{Orange} f}`}</ILatex>: la <b>funzione "effettiva"</b> del fenomeno</li>
|
||||
<li><ILatex>{r`{\color{Yellow} q}`}</ILatex>: la <b>funzione di regressione</b> che costruiamo per approssimarlo</li>
|
||||
<li><ILatex>{r`{\color{Red} Q }`}</ILatex>: la <b>funzione "errore di regressione"</b> da minimizzare</li>
|
||||
<li><ILatex>{r`(\ x_i, f(x_i)\ )`}</ILatex>: i <b>punti sperimentali</b></li>
|
||||
</ul>
|
||||
<p>
|
||||
L'obiettivo è minimizzare l'<b>errore di approssimazione</b> <ILatex>{r`Q`}</ILatex>, ovvero:
|
||||
</p>
|
||||
<PLatex>{r`\min {\color{Red} Q } = \sum_{i = 1}^m (\ {\color{Yellow} q(x_i)} - {\color{Orange} f(x_i)}\ )^2 `}</PLatex>
|
||||
</Panel>
|
||||
</Section>
|
||||
<Section>
|
||||
<Panel title={""}>
|
||||
|
||||
<Panel title={"Regressione lineare"}>
|
||||
<p>
|
||||
Trova la <b>retta</b> <ILatex>{r`{\color{Yellow} q}`}</ILatex> che meglio approssima tutti gli <ILatex>{r`m`}</ILatex> dati sperimentali.
|
||||
</p>
|
||||
<p>
|
||||
Essendo una retta, avrà <b>due parametri</b>: il termine noto <ILatex>{r`a_0`}</ILatex>, e la pendenza <ILatex>{`a_1`}</ILatex>.
|
||||
</p>
|
||||
<PLatex>{r`{\color{Yellow} q(x) } = a_0 + a_1 \cdot {\color{Green} x}`}</PLatex>
|
||||
<p>
|
||||
L'errore da minimizzare per ricavare i parametri sarà:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
\min {\color{Red} Q } = \sum_{i = 1}^m ( {\color{Yellow} a_0 + a_1 \cdot x_i} - {\color{Orange} f(x_i)} )^2
|
||||
`}</PLatex>
|
||||
</Panel>
|
||||
<Panel title={"Regressione lineare matriciale"}>
|
||||
<p>
|
||||
Possiamo costruire una <b>matrice di regressione</b> <ILatex>{r`A`}</ILatex> contenente tutti i <b>punti sperimentali</b>:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
A =
|
||||
\begin{pmatrix}
|
||||
1 & x_1\\\\
|
||||
1 & x_2\\\\
|
||||
\vdots & \vdots\\\\
|
||||
1 & x_m
|
||||
\end{pmatrix}
|
||||
`}</PLatex>
|
||||
<p>
|
||||
Inoltre, se costruiamo il <b>vettore dei parametri</b> <ILatex>{r`\alpha`}</ILatex>:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
\alpha =
|
||||
\begin{pmatrix}
|
||||
a_0\\\\
|
||||
a_1
|
||||
\end{pmatrix}
|
||||
`}</PLatex>
|
||||
<p>
|
||||
Avremo che:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Yellow} q(x) } = A \cdot \alpha`}</PLatex>
|
||||
<p>
|
||||
Inoltre, potremo calcolare l'errore attraverso la norma:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Red} Q } = \| A \cdot \alpha - y \|^2`}</PLatex>
|
||||
</Panel>
|
||||
</Section>
|
||||
<Section>
|
||||
<Panel title={"Regressione polinomiale"}>
|
||||
<p>
|
||||
Trova il <b>polinomio</b> <ILatex>{r`{\color{Yellow} q}`}</ILatex> di grado <ILatex>{r`n-1`}</ILatex> che meglio approssima tutti gli <ILatex>{r`m`}</ILatex> dati sperimentali.
|
||||
</p>
|
||||
<p>
|
||||
Essendo un polinomio di grado <ILatex>{r`n-1`}</ILatex>, avrà <ILatex>{r`n`}</ILatex> parametri.
|
||||
</p>
|
||||
<PLatex>{r`{\color{Yellow} q(x) } = a_0 + a_1 \cdot {\color{Green} x} + a_2 \cdot {\color{Green} x^2} +\ \dots \ + a_{n-1} \cdot {\color{Green} x^{n-1}`}</PLatex>
|
||||
<Example>
|
||||
<p>
|
||||
La regressione lineare è un caso particolare di regressione generale in cui i parametri sono 2!
|
||||
</p>
|
||||
</Example>
|
||||
<p>
|
||||
L'errore da minimizzare per ricavare i parametri sarà:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
\min {\color{Red} Q} = \sum_{i = 1}^m ( {\color{Yellow} a_0 + a_1 \cdot x_i + a_2 \cdot x_i^2 +\ \dots \ + a_{n-1} \cdot x_i^{n-1}} - {\color{Orange} y_i} )^2
|
||||
`}</PLatex>
|
||||
</Panel>
|
||||
<Panel title={"Regressione polinomiale matriciale"}>
|
||||
<p>
|
||||
Possiamo costruire una <b>matrice di regressione</b> <ILatex>{r`A`}</ILatex> contenente tutti i <b>punti sperimentali</b> a tutti i gradi del polinomio:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
A =
|
||||
\begin{pmatrix}
|
||||
1 & x_1 & x_1^2 & \dots & x_1^{n-1} \\\\
|
||||
1 & x_2 & x_2^2 & \dots & x_2^{n-1} \\\\
|
||||
\vdots & \vdots & \vdots & \ddots & \vdots \\\\
|
||||
1 & x_m & x_m^2 & \dots & x_m^{n-1}
|
||||
\end{pmatrix}
|
||||
`}</PLatex>
|
||||
<p>
|
||||
Inoltre, se costruiamo il <b>vettore dei parametri</b> <ILatex>{r`\alpha`}</ILatex>:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
\alpha =
|
||||
\begin{pmatrix}
|
||||
a_0\\\\
|
||||
a_1\\\\
|
||||
\vdots\\\\
|
||||
a_{n-1}
|
||||
\end{pmatrix}
|
||||
`}</PLatex>
|
||||
<p>
|
||||
Avremo che:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Yellow} q(x) } = A \cdot \alpha`}</PLatex>
|
||||
<p>
|
||||
Inoltre, potremo calcolare l'errore attraverso la norma:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Red} Q } = \| A \cdot \alpha - y \|^2`}</PLatex>
|
||||
<Example>
|
||||
Normalmente, i dati sono molti di più, ma se il numero di parametri <ILatex>{r`n`}</ILatex> fosse uguale al numero di dati <ILatex>{r`m`}</ILatex>, allora si otterrebbe il <b>polinomio di interpolazione</b>!
|
||||
</Example>
|
||||
</Panel>
|
||||
</Section>
|
||||
<Section>
|
||||
<Panel title={"Regressione generale"}>
|
||||
<p>
|
||||
Trova i <b>coefficienti della combinazione lineare</b> <ILatex>{r`{\color{Yellow} q}`}</ILatex> che meglio approssima tutti gli <ILatex>{r`m`}</ILatex> dati sperimentali.
|
||||
</p>
|
||||
<PLatex>{r`{\color{Yellow} q(x) } = a_0 \cdot {\color{Green} \phi_0 (x)} + a_1 \cdot {\color{Green} \phi_1 (x)} + \dots + a_2 \cdot {\color{Green} \phi_2 (x)} +\ \dots\ + a_{n-1} \cdot {\color{Green} \phi_{n-1} (x)}`}</PLatex>
|
||||
<Example>
|
||||
<p>
|
||||
La regressione polinomiale è un caso particolare di regressione generale in cui:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Green} \phi_{n} (x)} = x^n`}</PLatex>
|
||||
</Example>
|
||||
<p>
|
||||
L'errore da minimizzare per ricavare i parametri sarà:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
\min {\color{Red} Q } = \sum_{i = 1}^m ( {\color{Yellow} a_0 \cdot \phi_0 (x) + a_1 \cdot \phi_1 (x) + \dots + a_2 \cdot \phi_2 (x) +\ \dots\ + a_{n-1} \cdot \phi_{n-1} (x)} - {\color{Orange} f(x_i)} )^2
|
||||
`}</PLatex>
|
||||
</Panel>
|
||||
<Panel title={"Regressione polinomiale generale"}>
|
||||
<p>
|
||||
Possiamo costruire una <b>matrice di regressione</b> <ILatex>{r`A`}</ILatex> contenente tutti i <b>punti sperimentali</b> a tutti i gradi del polinomio:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
A =
|
||||
\begin{pmatrix}
|
||||
\phi_0(x_1) & \phi_1(x_1) & \phi_2(x_1) & \dots & \phi_{n_1}(x_1) \\\\
|
||||
\phi_0(x_2) & \phi_1(x_2) & \phi_2(x_2) & \dots & \phi_{n-1}(x_2) \\\\
|
||||
\vdots & \vdots & \vdots & \ddots & \vdots \\\\
|
||||
\phi_0(x_m) & \phi_1(x_m) & \phi_2(x_m) & \dots & \phi_{n-1}(x_m)
|
||||
\end{pmatrix}
|
||||
`}</PLatex>
|
||||
<p>
|
||||
Inoltre, se costruiamo il <b>vettore dei parametri</b> <ILatex>{r`\alpha`}</ILatex>:
|
||||
</p>
|
||||
<PLatex>{r`
|
||||
\alpha =
|
||||
\begin{pmatrix}
|
||||
a_0\\\\
|
||||
a_1\\\\
|
||||
\vdots\\\\
|
||||
a_{n-1}
|
||||
\end{pmatrix}
|
||||
`}</PLatex>
|
||||
<p>
|
||||
Avremo che:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Yellow} q(x) } = A \cdot \alpha`}</PLatex>
|
||||
<p>
|
||||
Inoltre, potremo calcolare l'errore attraverso la norma:
|
||||
</p>
|
||||
<PLatex>{r`{\color{Red} Q } = \| A \cdot \alpha - y \|^2`}</PLatex>
|
||||
</Panel>
|
||||
</Section>
|
||||
<Section title={"Trovare i parametri"}>
|
||||
<Panel title={"Caso non degenere"}>
|
||||
<p>
|
||||
Caso che prevede che le colonne di <ILatex>{r`A`}</ILatex> siano <b>linearmente indipendenti</b>.
|
||||
</p>
|
||||
<p>
|
||||
La soluzione <b>esiste</b> sempre, ed è <b>unica</b>.
|
||||
</p>
|
||||
<p>
|
||||
Per trovarla:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Fattorizziamo <ILatex>{r`A = Q \cdot \begin{pmatrix} R\\ 0 \end{pmatrix}`}</ILatex>.</li>
|
||||
<li>Calcoliamo <ILatex>{r`w = Q^T \cdot y`}</ILatex>.</li>
|
||||
<li>Teniamo solo i primi <ILatex>n</ILatex> valori di <ILatex>{r`w`}</ILatex> e mettiamoli in <ILatex>{r`w_1`}</ILatex>.</li>
|
||||
<li>Calcoliamo <ILatex>{r`R \cdot \alpha = w_1`}</ILatex>.</li>
|
||||
</ul>
|
||||
</Panel>
|
||||
<Panel title={"Caso generale"}>
|
||||
<p>
|
||||
Caso che non preclude alcuna composizione di <ILatex>{r`A`}</ILatex>.
|
||||
</p>
|
||||
</Panel>
|
||||
</Section>
|
||||
</Fragment>
|
||||
|
|
Loading…
Add table
Reference in a new issue