stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.59k stars 368 forks source link

I want to limit the effect of variables in regression analysis to positive values. #3213

Closed akhrt01 closed 1 year ago

akhrt01 commented 1 year ago

Summary:

I want to limit the effect of variables in regression analysis to positive values.

Description:

I am analyzing the impact of multiple advertisements on sales by regression analysis. I want to make it a prerequisite that advertising has a positive impact on sales. How can I enter Stan's code to limit the variable's influence to positive values?

Reproducible Steps: & Current Output:

I typed "parameters{ real p;}", and I have tried several prior distribution settings. (for example "model{p~normal(0.5,0.2);")

Reproducible Steps: & Current Output:

Some variables have negative influence.

Expected Output:

I want to limit the effect of variables in regression analysis to positive values.

Current Version:

v2.32.2

mitzimorris commented 1 year ago

please use the Stan forums: https://discourse.mc-stan.org and consult the Stan User's Guide https://mc-stan.org/docs/stan-users-guide/index.html which shows how to code different kinds of models.