Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: how to search the optimal parameter

 From Jorge Eduardo Pérez Pérez To "statalist@hsphsun2.harvard.edu" Subject Re: st: how to search the optimal parameter Date Wed, 2 May 2012 17:08:45 -0400

```This sounds to me like a regression with interval constraints

http://www.stata.com/support/faqs/stat/interval-constraints.html

_______________________
Jorge Eduardo Pérez Pérez

On Wed, May 2, 2012 at 3:42 PM, econqian222
<maguixianstatalist@gmail.com> wrote:
>
> Hi,everyone
>    I'm searching for an optimal value of "a" belong to the scale [1.05,
> 131.5] at interval that is 0.05, “b" belong to the scale of [0, (a-1)/a] at
> interval that is (a-1)/30a
>    To minimize the sum of "u^2" by each value of code(1,2,3,4,...), where
> u=y-ax1-bx2, we need to search the optimal value of "a" and "b" within their
> respective scale and interval for each value of code(1,2,3,4,...).
>    How should I write the program for this task?
>
> the format of data goes as following:
> code       y               x1             x2
> 1       4.65605 .7904362        -1.918414
> 1       8.55465 .388749 -1.823626
> 1       .5072982        6.095053        -1.758411
> 2       .0668553        .0946494        -.0795475
> 2       4.346485        .0366412        .3990744
> 2       .453282 .6764894        .5537513
> 2       2.514498        4.424465        -3.335462
> 3       5.027869        6.576887        5.750454
> 3       1.121937        5.153405        2.404536
> 3       .3745422        .2155463        -.2841324
> 3       1.061227        .0074581        -.0889647
> 4       3.328544        12.11974        -6.351465
> 4       .1192554        .3238932        -.196535
> 4       71.84912        .3888368        5.285602
> .       .                    .          .
> .       .                    .          .
>
> Qian
>
>
> --
> View this message in context: http://statalist.1588530.n2.nabble.com/how-to-search-the-optimal-parameter-tp7521410.html
> Sent from the Statalist mailing list archive at Nabble.com.
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```