Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NonLinearRegression Weights

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73629] Re: NonLinearRegression Weights
  • From: Lawrence Walker <lwalker701 at earthlink.net>
  • Date: Fri, 23 Feb 2007 04:39:46 -0500 (EST)
  • References: <erjoum$pp0$1@smc.vnet.net>


pershan at seas.harvard.edu wrote:
> The command I am using is:
>    fitting[x_] = NonlinearFit[data, f[x], {x}, {
>    {Background, {0, 1000}},
>    {Amplitude, {10, 0}},
>    {Wid, {10, 25}}}, Weights -> wt]
> where wt is a column vector that has precisely the same length as the
> data file.

Column vector?  Did you use something like Weights ->{{1},{1},...} 
instead of Weights->{1,1,...}?

> This command works perfectly if I use either Weights->Automatic or
> something like Weights -> (Sqrt[#] &)
> On the other hand, when the weights are from a list {....} I get the
> following error.
> 
>    NonlinearFit::bdwghts: Warning: Value of option Weights ->
>    {{0.00322435}, \
>    {0.00359912}, \[LeftSkeleton]8\[RightSkeleton], \[LeftSkeleton]31\
>    \[RightSkeleton]} is not Automatic, a pure function mapping a
>    response to a \
>    non-negative numerical weight, or a non-negative numerical vector
>    having the \
>    same length as the data. Setting all weights to 1 (Weights ->
>    Automatic).

The error you are getting leads me to believe that the value to the 
Weights option is not a vector of numbers (VectorQ[#,NumericQ]&).


  • Prev by Date: Re: split
  • Next by Date: Re: Next representable number
  • Previous by thread: Re: NonLinearRegression Weights
  • Next by thread: Re: Change multiplication operations into convolution