Nonlinear regression with nested models and two or more independent variables
Mostrar comentarios más antiguos
Hello everyone, I would appreciate if anyone could help me.
I'm trying to find parameters a0, a1, n0, and n1 that best describe my response variable (z) as a function of two independent variables (x, y).
My equation set is:
- z(x, y) = -a(y) * x ^ [n(y)]
- a(y) = ln{1 + exp[a0 * (y - a1)]}
- n(y) = n0*exp(-n1 * y)
My dataset is:
- x = [0 1 2 3 4 12 24 0 1 2 3 4 8 16 24 0 1 2 3 4 0 0.5 1 2 3 4];
- y = [100 100 100 100 100 100 100 200 200 200 200 200 200 200 200 300 300 300 300 300 400 400 400 400 400 400];
- z = [0 0.59 0.76 0.33 -0.2 -0.28 -0.3 0 -1.27 -0.11 -0.3 -1.03 -1.21 -1.55 -2.6 0 -0.58 -0.73 -2.48 -2.56 0 -0.5 -3.4 -3.69 -4.78 -3.96];
I already tried the following code to define my z(x, y) function:
a = @(ap, y)(log(1 + exp(-ap(1)*(y - ap(2)))))
n = @(np, y)(np(1)*exp(-np(2)*y))
zp = {a, n}
z = @(zp, x)(-zp(1)*x^(zp(2)))
Apparently, the function z(x, y) is correctly defined. I also tried the following code to define parameter vectos "a" and "n" to evaluate the z(x, y), but it did not work and I ignore how to do this.
ap0 = [150 2];
np0 = [2 0.1];
S(pars, t)
After evaluating the function, I would appreciate if someone taught how to use the "fminsearch" function when using two independent variables and two different parameter arryas (a, n)
Thanks you for your time,
Vinicio
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Systems of Nonlinear Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!