issues: 1674818753
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1674818753 | I_kwDOAMm_X85j07TB | 7768 | Supplying multidimensional initial guess to `curvefit` | 20118130 | closed | 0 | 5 | 2023-04-19T12:37:53Z | 2024-03-25T20:02:14Z | 2023-05-31T12:43:09Z | CONTRIBUTOR | Is your feature request related to a problem?Hi, I'm trying to use ```python import numpy as np import xarray as xr x = xr.DataArray(coords=[("x", np.linspace(0, 10, 101))]).x i = xr.DataArray(coords=[("experiment_index", [1, 2, 3])]).experiment_index data = 2.0 * i * x + 5 m_guess = 2 * i data.curvefit(
"x",
lambda x, m, b: m * x + b,
p0={"m": m_guess} # I would like to provide a guess for 'm' as a function of Describe the solution you'd likeI would like to be able to provide arrays as the values of I suppose this could also be implemented for bounds. Describe alternatives you've consideredI could wrap
But this is quite cumbersome, especially for multidimensional data. Additional contextThe above example gives the error
~~The above example gives the error~~
This toy example of course works with just a scalar guess like The initial guess is inserted into |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7768/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |