Sei sulla pagina 1di 10

FORMULARIO DE METODOS NUMERICOS

REGRESION POR MÍNIMOS CUADRADOS

 Media aritmética
∑ 𝑦𝑖
𝑦̅ =
𝑛
∑ 𝑥𝑖
𝑥̅ =
𝑛
 Desviación estándar:

𝑆𝑡
𝑆𝑦 = √
𝑛−1
2
𝑆𝑡 = ∑(𝑦𝑖 − 𝑦̅)

 Varianza:
∑(𝑦𝑖 − 𝑦̅)2
𝑆𝑦 2 =
𝑛−1
 Coeficiente de variación:
𝑆𝑦
𝑐. 𝑣 = 100%
𝑦̅
 Regresión lineal

𝑦 = 𝑎𝑜 + 𝑎1 𝑥 + 𝑒

𝑛 𝑛

𝑆𝑟 = ∑(𝑦𝑖,𝑚𝑒𝑑𝑖𝑑𝑎 − 𝑦𝑖,𝑚𝑜𝑑𝑒𝑙𝑜 ) = ∑(𝑦𝑖 − 𝑎𝑜 − 𝑎1 𝑥𝑖 )2


2

𝑖=1 𝑖=1

𝑛 ∑ 𝑥𝑖 𝑦𝑖 − ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑎1 =
𝑛 ∑ 𝑥𝑖 2 − (∑ 𝑥𝑖 )2

𝑎𝑜 = 𝑦̅ − 𝑎1 𝑥̅

 Error estándar de la estimación

𝑆𝑟
𝑆𝑦/𝑥 = √
𝑛−2

 Coeficiente de determinación
𝑆𝑡 − 𝑆𝑟
𝑟2 =
𝑆𝑡
 Coeficiente de correlación:

𝑟 = √𝑟 2
𝑛 ∑ 𝑥𝑖 𝑦𝑖 − (∑ 𝑥𝑖 )(∑ 𝑦𝑖 )
𝑟=
√𝑛 ∑ 𝑥𝑖 2 − (∑ 𝑥𝑖 )2 √𝑛 ∑ 𝑦𝑖 2 − (∑ 𝑦𝑖 )2

 Regresión no lineales

𝑦 = 𝑎1 𝑒 𝛽1 𝑥

𝑦 = 𝑎2 𝑥 𝛽2

 Regresión polinomial
𝑦 = 𝑎𝑜 + 𝑎1 𝑥 + 𝑎2 𝑥 2 + 𝑒

𝑆𝑟 = ∑(𝑦𝑖 − 𝑎𝑜 − 𝑎1 𝑥𝑖 − 𝑎2 𝑥 2 )2
𝑖=1

La ecuación para formar la matriz queda de la siguiente manera:

(𝑛)𝑎𝑜 + (∑ 𝑥𝑖 ) 𝑎1 + (∑ 𝑥𝑖 2 ) 𝑎2 = ∑ 𝑦𝑖

(∑ 𝑥𝑖 ) 𝑎𝑜 + (∑ 𝑥𝑖 2 ) 𝑎1 + (∑ 𝑥𝑖 3 ) 𝑎2 = ∑ 𝑥𝑖 𝑦𝑖

(∑ 𝑥𝑖 2 ) 𝑎𝑜 + (∑ 𝑥𝑖 3 ) 𝑎1 + (∑ 𝑥𝑖 4 ) 𝑎2 = ∑ 𝑥𝑖 2 𝑦𝑖

 Error estándar de la estimación

𝑆𝑟
𝑆𝑦/𝑥 = √
𝑛 − (𝑚 + 1)

 Regresión lineal múltiple


𝑦 = 𝑎𝑜 + 𝑎1 𝑥1 + 𝑎2 𝑥2 + 𝑒

𝑆𝑟 = ∑(𝑦𝑖 − 𝑎𝑜 − 𝑎1 𝑥𝑖 − 𝑎2 𝑥 2 )2
𝑖=1

La ecuación para formar la matriz queda de la siguiente manera:

𝑛 ∑ 𝑥1𝑖 ∑ 𝑥2𝑖 ∑ 𝑦𝑖
𝑎0
∑ 𝑥1𝑖 ∑ 𝑥1𝑖 2 ∑ 𝑥1𝑖 𝑥2𝑖 {𝑎1 } = ∑ 𝑥1𝑖 𝑦𝑖
𝑎2
[∑ 𝑥2𝑖 ∑ 𝑥1𝑖 𝑥2𝑖 ∑ 𝑥2𝑖 2 ] {∑ 𝑥2𝑖 𝑦𝑖 }
 Error estándar de la estimación

𝑆𝑟
𝑆𝑦/𝑥 = √
𝑛 − (𝑚 + 1)
Ecuaciones de potencias:

𝑦 = 𝑎𝑜 𝑥1 𝑎1 𝑥2 𝑎2 … . 𝑥𝑚 𝑎𝑚

Ecuaciones de logaritmos:

𝑙𝑜𝑔𝑦 = 𝑙𝑜𝑔𝑎𝑜 + 𝑎1 𝑙𝑜𝑔𝑥1 + 𝑎2 𝑙𝑜𝑔𝑥2 + ⋯ + 𝑎𝑚 𝑙𝑜𝑔𝑥𝑚

INTERPOLACIÓN

INTERPOLACIÓN POLINOMIAL DE NEWTON EN DIFERENCIAS DIVIDIDAS

 Interpolación lineal

𝑓(𝑥1 ) − 𝑓(𝑥0 )
𝑓1 (𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 )
𝑥1 − 𝑥0

 Interpolación cuadrática

𝑓2 (𝑥) = 𝑏0 + 𝑏1 (𝑥 − 𝑥0 ) + 𝑏2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )

Donde:

𝑏0 = 𝑓(𝑥0 )

𝑓(𝑥1 ) − 𝑓(𝑥0 )
𝑏1 =
𝑥1 − 𝑥0

𝑓(𝑥2 ) − 𝑓(𝑥1 ) 𝑓(𝑥1 ) − 𝑓(𝑥0 )


𝑥2 − 𝑥1 − 𝑥1 − 𝑥0
𝑏2 =
𝑥2 − 𝑥0

 Polinomios de interpolación de Lagrange


𝑛

𝑓𝑛 (𝑥) = ∑ 𝐿𝑖 (𝑥)𝑓(𝑥𝑖 )
𝑖=0
Donde

𝑛
𝑥 − 𝑥𝑗
𝐿𝑖 (𝑥) = ∏
𝑥𝑖 − 𝑥𝑗
𝑗=0
𝑗≠𝑖

La versión lineal (n=1) es:

𝑥 − 𝑥1 𝑥 − 𝑥0
𝑓1 (𝑥) = 𝑓(𝑥0 ) + 𝑓(𝑥1 )
𝑥0 − 𝑥1 𝑥1 − 𝑥0

La versión de segundo grado es:

(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )


𝑓2 (𝑥) = 𝑓(𝑥0 ) + 𝑓(𝑥1 ) + 𝑓(𝑥2 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )

 Coeficientes de un polinomio de interpolación


𝑓(𝑥) = 𝑎𝑜 + 𝑎1 𝑥 + 𝑎2 𝑥 2 + ⋯ + 𝑎𝑛 𝑥 𝑛
Se requiere de tres puntos: [𝑥0 , 𝑓(𝑥0 )], [𝑥1 , 𝑓(𝑥1 )] y [𝑥2 , 𝑓(𝑥2 )].
𝑓(𝑥0 ) = 𝑎0 + 𝑎1 𝑥0 + 𝑎2 𝑥0 2
𝑓(𝑥1 ) = 𝑎0 + 𝑎1 𝑥1 + 𝑎2 𝑥1 2
𝑓(𝑥2 ) = 𝑎0 + 𝑎1 𝑥2 + 𝑎2 𝑥2 2
 Interpolación inversa
x 1 2 3 4 5 6 7
y 1 0.5 0.3333 0.25 0.2 0.1667 0.1429

Se transforma en:
f(x) 0.1429 0.1667 0.2 0.25 0.3333 0.5 1
y 7 6 5 4 3 2 1

INTERPOLACIÓN MEDIANTE TRAZADORES (SPLINES)

 Trazadores lineales

𝑓(𝑥𝑖+1 ) − 𝑓(𝑥𝑖 )
𝑚𝑖 =
𝑥𝑖+1 + 𝑥𝑖

 Trazadores cuadráticos
𝑓𝑖 (𝑥) = 𝑎𝑖 𝑥 2 + 𝑏𝑖 𝑥 + 𝑐𝑖
1. Los valores de la función de polinomios adyacentes deben ser iguales en los
nodos interiores. Con i=2, en total 2n-2 condiciones
𝑎𝑖−1 𝑥 2 𝑖−1 + 𝑏𝑖−1 𝑥𝑖−1 + 𝑐𝑖−1 = 𝑓(𝑥𝑖−1 )
𝑎𝑖 𝑥 2 𝑖−1 + 𝑏𝑖 𝑥𝑖−1 + 𝑐𝑖−1 = 𝑓(𝑥𝑖−1 )
2. La primera y la última función deben pasar a través de los puntos extremos. En
total tenemos 2n-2+2=2n condiciones
𝑎1 𝑥 2 0 + 𝑏1 𝑥0 + 𝑐1 = 𝑓(𝑥0 )
𝑎𝑛 𝑥 2 𝑛 + 𝑏𝑛 𝑥𝑛 + 𝑐𝑛 = 𝑓(𝑥𝑛 )
3. Las primeras derivadas en los nodos interiores deben ser iguales. De manera
general la condición se representa como:
2𝑎𝑖−1 𝑥𝑖−1 + 𝑏𝑖−1 = 2𝑎𝑖 𝑥𝑖−1 + 𝑏𝑖
4. Suponga que en el primer punto la segunda derivada es cero.
𝑎1 = 0
 Trazadores cúbicos
𝑓𝑖 (𝑥) = 𝑎𝑖 𝑥 3 + 𝑏𝑖 𝑥 2 + 𝑐𝑖 𝑥 + 𝑑𝑖

𝑓 ′′ 𝑖 (𝑥𝑖−1 ) 𝑓 ′′ 𝑖 (𝑥𝑖 )
𝑓𝑖 (𝑥) = (𝑥𝑖 − 𝑥)3 + (𝑥 − 𝑥𝑖−1 )3
6(𝑥𝑖 − 𝑥𝑖−1 ) 6(𝑥𝑖 − 𝑥𝑖−1 )
𝑓(𝑥𝑖−1 ) 𝑓 ′′ 𝑖 (𝑥𝑖−1 )(𝑥𝑖 − 𝑥𝑖−1 )
+[ − ] (𝑥𝑖 − 𝑥)
𝑥𝑖 − 𝑥𝑖−1 6
𝑓(𝑥𝑖 ) 𝑓 ′′ (𝑥𝑖 )(𝑥𝑖 − 𝑥𝑖−1 )
+[ − 𝑖 ] (𝑥 − 𝑥𝑖−1 )
𝑥𝑖 − 𝑥𝑖−1 6

(𝑥𝑖 − 𝑥𝑖−1 )𝑓 ′′ (𝑥𝑖−1 ) + 2(𝑥𝑖+1 − 𝑥𝑖−1 )𝑓 ′′ (𝑥𝑖 ) + (𝑥𝑖+1 − 𝑥𝑖 )𝑓 ′′ (𝑥𝑖+1 )


6 6
= [𝑓(𝑥𝑖+1 ) − 𝑓(𝑥𝑖 )] + [𝑓(𝑥𝑖−1 ) − 𝑓(𝑥𝑖 )]
𝑥𝑖+1 − 𝑥𝑖 𝑥𝑖 − 𝑥𝑖−1
DIFERENCIACIÓN E INTEGRACIÓN NUMÉRICA

 Fórmulas de integración de Newton-Cotes

𝑏 𝑏
𝐼 = ∫ 𝑓(𝑥)𝑑𝑥 ≅ ∫ 𝑓𝑛 (𝑥)𝑑𝑥
𝑎 𝑎

Donde 𝑓𝑛 (𝑥) es igual a un polinomio de la forma:

𝑓𝑛 (𝑥) = 𝑎𝑜 + 𝑎1 𝑥 + ⋯ + 𝑎𝑛−1 𝑥 𝑛−1 + 𝑎𝑛 𝑥 𝑛

 Regla del trapecio

𝑏 𝑏
𝐼 = ∫ 𝑓(𝑥)𝑑𝑥 ≅ ∫ 𝑓1 (𝑥)𝑑𝑥
𝑎 𝑎

𝑓(𝑎) + 𝑓(𝑏)
𝐼 = (𝑏 − 𝑎)
2

 Error de la regla del tracio


1
𝐸𝑎 = − 𝑓′′(£)(𝑏 − 𝑎)3
12

𝑏
∫ 𝑓′′(𝑥)𝑑𝑥
𝑓 ′′ (£)
= 𝑎
𝑏−𝑎
 Regla del trapecio múltiple
𝑏−𝑎
ℎ=
𝑛

𝑓(𝑥𝑜 ) + 2 ∑𝑛−1
𝑖=1 𝑓(𝑥𝑖 ) + 𝑓(𝑥𝑛 )
𝐼 = (𝑏 − 𝑎)
2𝑛

 Error
(𝑏 − 𝑎)3 ′′
𝐸𝑎 = − 𝑓 (£)
12𝑛2
𝑏
∫ 𝑓′′(𝑥)𝑑𝑥
𝑓 ′′ (£)
= 𝑎
𝑏−𝑎

REGLA DE SIMPSON

 REGLA DE SIMPSON 1/3


𝑏−𝑎
ℎ=
2
𝑓(𝑥𝑜 ) + 4𝑓(𝑥1 ) + 𝑓(𝑥2 )
𝐼 = (𝑏 − 𝑎)
6

 Error
ℎ5 (4)
𝐸𝑡 = − 𝑓 (£)
90
(𝑏 − 𝑎)5 (4)
𝐸𝑎 = − 𝑓 (£)
2880
𝑏
(4) (£)
∫𝑎 𝑓 (4) (𝑥)𝑑𝑥
𝑓 =
𝑏−𝑎

 Regla de Simpson 1/3 múltiple

𝑏−𝑎
ℎ=
𝑛
𝑓(𝑥𝑜 ) + 4 ∑𝑛−1 𝑛−1
𝑖=1,3,5 𝑓(𝑥𝑖 ) + 4 ∑𝑗=2,4,6 𝑓(𝑥𝑗 ) + 𝑓(𝑥𝑛 )
𝐼 = (𝑏 − 𝑎)
3𝑛

 Error
(𝑏 − 𝑎)5 (4)
𝐸𝑎 = − 𝑓 (£)
180𝑛4
𝑏
∫ 𝑓 (4) (𝑥)𝑑𝑥
𝑓 (4) (£)
= 𝑎
𝑏−𝑎

 Regla de Simpson 3/8

𝑏−𝑎
ℎ=
𝑛
𝑓(𝑥𝑜 ) + 3𝑓(𝑥1 ) + 3𝑓(𝑥2 ) + 𝑓(𝑥3 )
𝐼 = (𝑏 − 𝑎)
8

 Error
3ℎ5 (4)
𝐸𝑡 = − 𝑓 (£)
80
(𝑏 − 𝑎)5 (4)
𝐸𝑎 = − 𝑓 (£)
6480
𝑏
∫ 𝑓 (4) (𝑥)𝑑𝑥
𝑓 (4) (£)
= 𝑎
𝑏−𝑎
 Integración con segmentos desiguales
𝑓(𝑥𝑜 ) + 𝑓(𝑥1 ) 𝑓(𝑥1 ) + 𝑓(𝑥2 ) 𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )
𝐼 = ℎ1 + ℎ2 + ⋯ + ℎ𝑛
2 2 2

INTEGRACIÓN DE ECUACIONES
 Extrapolación de Richardson
4 1
𝐼 = 𝐼(ℎ2 ) − 𝐼(ℎ1 )
3 3

 Cuadratura de Gauss
𝑓(𝑎) + 𝑓(𝑏)
𝐼 = (𝑏 − 𝑎)
2

DIFERENCIACIÓN NUMÉRICA
 Diferencias divididas finitas hacia adelante:
 Diferencias divididas finitas hacia atras:

 Diferencias divididas finitas centradas:


 Extrapolación de Richardson:
4 1
𝐷 ≅ 𝐷(ℎ2 ) − 𝐷(ℎ1 )
3 3
𝐷(ℎ1 ) 𝑦 𝐷(ℎ2 ) 𝑠𝑒 𝑟𝑒𝑠𝑢𝑒𝑙𝑣𝑒𝑛 𝑐𝑜𝑛 𝑑𝑖𝑓𝑒𝑟𝑒𝑛𝑐𝑖𝑎𝑠 𝑑𝑖𝑣𝑖𝑑𝑎𝑠 𝑐𝑒𝑛𝑡𝑟𝑎𝑑𝑎𝑠 𝑝𝑎𝑟𝑎 𝑚𝑎𝑠 𝑒𝑥𝑎𝑐𝑡𝑖𝑡𝑢𝑑

 Derivadas de datos irregularmente espaciados

2𝑥 − 𝑥𝑖 − 𝑥𝑖+1 2𝑥 − 𝑥𝑖−1 − 𝑥𝑖+1


𝑓 ′ (𝑥) = 𝑓(𝑥𝑖−1 ) + 𝑓(𝑥𝑖 )
(𝑥𝑖−1 − 𝑥𝑖 )(𝑥𝑖−1 − 𝑥𝑖+1 ) (𝑥𝑖 − 𝑥𝑖−1 )(𝑥𝑖 − 𝑥𝑖+1 )
2𝑥 − 𝑥𝑖−1 − 𝑥𝑖
+ 𝑓(𝑥𝑖+1 )
(𝑥𝑖+1 − 𝑥𝑖−1 )(𝑥𝑖+1 − 𝑥𝑖 )

Potrebbero piacerti anche