Multivariate Nonlinear Regression

maybe try something like this

function multimodel(x, p)
    a = x[:,1]
    t = x[:,2]
    α = p[1]
    τ = p[2]
    @. α * a * τ * t^2
end

a = []
t = []
trange = -1.0:0.1:1.0
arange = 0.0:0.1:1.0
for _t in trange , _a in arange
    push!(a,_a)
    push!(t,_t)
end

p = [0.9,1.1]
x = [a t]

y = multimodel(x, p) + 0.1 * rand(size(a,1))

using Plots
Plots.plot(a,t,y,seriestype=:surface)
3 Likes