Nonlinear curve fitting with weights with LsqFit

Sorry, please provide a piece of code that is completely defined. I tried your code and get the message:


julia> @. model(t, p) = p[1]*(0.5)^(t/p[2])
model (generic function with 1 method)

julia> fit  = curve_fit(model, x, y, weights, [0.1, 60])
ERROR: UndefVarError: x not defined
Stacktrace:
 [1] top-level scope
   @ REPL[3]:1

What are x, y and the weights?

In particular:
"
Do your best to make your example self-contained (“minimal working example”, MWE ), so that it runs (or gets to the error that you want help with) as is. This means including package loading (e.g. using ThatPackage ) and any data that the code operates on. If your data is large or proprietary, generate example data if possible and include that. This StackOverflow answer explains how a DataFrame can be turned into a string representation that can be copy/pasted.
"