# Multivariate Nonlinear Regression

**URL:** <https://discourse.julialang.org/t/multivariate-nonlinear-regression/25887>\
**Category:** Optimization (Mathematical)\
**Created:** [July 1, 2019, 7:13am UTC](https://discourse.julialang.org/t/multivariate-nonlinear-regression/25887 "2019-07-01T07:13:58Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [July 2, 2019, 11:44am UTC](https://discourse.julialang.org/t/multivariate-nonlinear-regression/25887/10 "2019-07-02T11:44:01Z")

</div>

Okay, now I see what you wanted to do. Do you realize why the suggestion worked?

To use LsqFit you need to provide a number (N) of _observations_. In your case, the observations are chosen by you: you want to sample a the full tensor grid defined by two (in this case) vectors. Then you have to consider each combination/point as one observation. This obviously means that some `a`s are going to be repeated for some `t`s and vice versa. This is the part I didn’t understand when you said “why do a and t have to be of the same length” - well because you need N pairs!

---

_[View the full topic](https://discourse.julialang.org/t/multivariate-nonlinear-regression/25887)._
