negative weights

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

negative weights

BBands
lsfit does not allow negative weights. Is there a similar function that does?

     jab
--
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
Reply | Threaded
Open this post in threaded view
|

Re: negative weights

Dirk Eddelbuettel

Hi John,

On 28 April 2006 at 15:48, BBands wrote:
| lsfit does not allow negative weights. Is there a similar function that does?

When OLS is generalized to GLS (also called WLS), weights are typically
thought to account for varying degrees of uncertainty reflected in varying
sizes of residuals.  But you are still minimizing a sum of squares in which
each observation contributes at least some marginal bits of observations.

So negative weights don't really fit that framework. That said, from a purely
numerical as opposed to statistical point of view you can probably minimize a
suitable expression with nls() or optim().  But you'd be 'on your own out
there'.

Hope this helps,  Dirk

--
Hell, there are no rules here - we're trying to accomplish something.
                                                  -- Thomas A. Edison

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
Reply | Threaded
Open this post in threaded view
|

Re: negative weights

BBands
On 4/28/06, Dirk Eddelbuettel <[hidden email]> wrote:
> So negative weights don't really fit that framework. That said, from a purely
> numerical as opposed to statistical point of view you can probably minimize a
> suitable expression with nls() or optim().  But you'd be 'on your own out
> there'.

Hi Dirk,

I was looking for an all-in sort of solution, but preprocessing the
data will get me where I need to go, so no traipsing around in the
'out there' for me. Perhaps I don't have the necessary statistical
sophistication, but negative weights for linear models seem like a
perfectly reasonable solution to the problem of different forecasting
abilities at different horizons.

     jab
--
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
Reply | Threaded
Open this post in threaded view
|

Fwd: negative weights

BBands
On 4/28/06, Dirk Eddelbuettel <[hidden email]> wrote:
>
> Hm, you didn't mention forecasting. I am not even sure where weights would
> enter there...

On 4/29/06, Patrick Burns <[hidden email]> wrote:

> I'm not sure what you are aiming at.  I would think
> that a negative weight would mean that the bigger
> the residual for that observation, the better.

I build these models to forecast future returns, but maybe I am
barking up the wrong tree on this one. Let's use a very widely
accepted meme to see:

Suppose you buy into the Columbine thesis that mean reversion prevails
in the short term while momentum prevails in the long term. Let's look
at the simplest model that can capture that thesis, a
two-period-return model where a is the long-term return and b is the
short-term return. In order for this model to work you would need
weights of something like 1 and -1 for a and b respectively. Now
expand the model to a reasonable number of returns and a larger number
of securities and a regression using a shaped set of weights including
negative weights starts to look like an attractive idea. Of course I
can preprocess the data and then feed it to the model...

Any ideas?

    jab
--
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: negative weights

Gabor Grothendieck
On 4/29/06, BBands <[hidden email]> wrote:

> On 4/28/06, Dirk Eddelbuettel <[hidden email]> wrote:
> >
> > Hm, you didn't mention forecasting. I am not even sure where weights would
> > enter there...
>
> On 4/29/06, Patrick Burns <[hidden email]> wrote:
>
> > I'm not sure what you are aiming at.  I would think
> > that a negative weight would mean that the bigger
> > the residual for that observation, the better.
>
> I build these models to forecast future returns, but maybe I am
> barking up the wrong tree on this one. Let's use a very widely
> accepted meme to see:
>
> Suppose you buy into the Columbine thesis that mean reversion prevails
> in the short term while momentum prevails in the long term. Let's look
> at the simplest model that can capture that thesis, a
> two-period-return model where a is the long-term return and b is the
> short-term return. In order for this model to work you would need
> weights of something like 1 and -1 for a and b respectively. Now
> expand the model to a reasonable number of returns and a larger number
> of securities and a regression using a shaped set of weights including
> negative weights starts to look like an attractive idea. Of course I
> can preprocess the data and then feed it to the model...
>
> Any ideas?

I think you will need to specify your model more concretely to get more
than passing comments.  At any rate, note that if the weights can be
negative then the sum of squares to be optimized is no longer a convex function
of the coefficients so we really don't have a conventional least squares
model and uniqueness and existence have possibly different answers.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: negative weights

BBands
In reply to this post by BBands
On 4/30/06, Dan Rie <[hidden email]> wrote:

> but in most cases does not change the expected
> value of the coefficient estimates themselves.

That was an aha for me, though I should have known it... I calculated
a couple of regressions by hand with varying weight schemes to verify
and I get it now. (Actually I saw this early on, but assumed it was a
mistake in my usage of R.) For my purposes I must apply the weights to
the dependent returns prior to doing an unweighted regression. An
initial pass on purpose-built test data produced intuitively correct
results.

Thanks to all,

    jab
--
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
Reply | Threaded
Open this post in threaded view
|

Re: negative weights

Spencer Graves
In reply to this post by BBands
          Weights in 'nls' and in forecasting are two very different things.
Weights in functions like 'nls', 'lm', 'lme', and often also 'optim' are
typically justified from a maximum likelihood argument.  In that case,
the weights are (exactly or metaphorically, depending on context)
inversely proportional to the variances of the observations.  Negative
weights in that context implies imaginary standard deviations;  I'll let
you extrapolate from there.

          Weights in forecasting, however, commonly occur when modeling, for
example, the output of a reactor:  If the reactor delivers less than its
standard output on one cycle, it will often do the opposite on the next.
  This is common with straight "moving average" models in the standard
time series literature, e.g., the famous Box and Jenkins (or Box,
Jenkins and Reinsel now) book "Time Series Analysis, Forecasting and
Control".  Any good book on "arima" / "Box Jenkins" modeling should
discuss this.  You can get started on this with the time series chapter
in the Venables and Ripley book, "Modern Applied Statistics with S".

          hope this helps,
          spencer graves

BBands wrote:

> On 4/28/06, Dirk Eddelbuettel <[hidden email]> wrote:
>> So negative weights don't really fit that framework. That said, from a purely
>> numerical as opposed to statistical point of view you can probably minimize a
>> suitable expression with nls() or optim().  But you'd be 'on your own out
>> there'.
>
> Hi Dirk,
>
> I was looking for an all-in sort of solution, but preprocessing the
> data will get me where I need to go, so no traipsing around in the
> 'out there' for me. Perhaps I don't have the necessary statistical
> sophistication, but negative weights for linear models seem like a
> perfectly reasonable solution to the problem of different forecasting
> abilities at different horizons.
>
>      jab
> --
> John Bollinger, CFA, CMT
> www.BollingerBands.com
>
> If you advance far enough, you arrive at the beginning.
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance