[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: "Weighted" least squares
I am trying to solve a relatively simple estimation problem that implies
negative "weights" (more on my weights below), but as long as it is
possible I want to use some variable transformation to use Stata's
standard commands. My question, then, refers to the best way of
estimating this type of problems, with or without Stata's variations of
I have read Stata's documentation for weights, but I am a bit confused
about the distinction (if any) between "OLS with weights", which is what
Stata does, and "Weighted OLS", which is what I need... Regarding
Weighted OLS and my objective function for minimization, see for
The problems I need to solve are variations of least squares of the
(1) argmin(a,b)E[Ki(Yi-a-bXi)^2] (linear OLS if all Ki=1)
(2) argmin(a,b)E[Ki(Yi-F(a-bXi))^2] (probit if all Ki=1)
with Ki being positive and negative, and:
(3) argmin(a,b)E[Ki*So(Yi-a-bXi)^2] (qreg if Ki=1) (So is the objective
function for the qreg problem).
with positive Kis.
These Ki are what I (and the web reference above) call weights. My first
idea was a creative use of i/aweights, or variable transformations, but
after a discussion with Stata Support, and discussions from this list, I
think it does not work. Solving the problem for (1) is not too hard,
shouldn't be too hard for (2), and I don't know where to start with (3),
but ideally I would like to know if there is a general approach to
solving the problem of minimizing Ki*(y-Fi[x])^2...
Regarding the powerful "nl" procedure, although similar to what I want
to do, I have a problem because my weights can be negative:
nl finds b to minimize Sum_j (u_j^2), with:
y_j = f(X_j,b) + u_j
What I need to do is find b to minimize Sum_j [(Ki)*(u_j^2)]...
Thank you very much for your help
* For searches and help try: