<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: proc model : vector of restrictions in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/832066#M4501</link>
    <description>&lt;P&gt;Alexey,&lt;/P&gt;
&lt;P&gt;If you want to programmatically generate your list of restrictions then you can use the SAS macro language.&amp;nbsp; Here's an example that shows how a RESTRICT statement could be generated from values stored in a data set.&lt;/P&gt;
&lt;P&gt;Marc&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
   do t = 2 to 12 by 2;
	   output;
	end;
run;

data _null_;
   length eqs $ 1024;
   set d;
	eqname = 'eq'||left(put(_n_,6.));
	call symput(eqname, "lhs = " || t);
run;


%macro restricts;
   restrict
   %do i = 1 %to 6; 
		%unquote(&amp;amp;eq&amp;amp;i)
		%if &amp;amp;i ne 6 %then,
   %end;
	;
%mend restricts; 


proc tmodel;&lt;BR /&gt;   ... your model code  ... 
   %restricts;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Sep 2022 23:50:12 GMT</pubDate>
    <dc:creator>kessler</dc:creator>
    <dc:date>2022-09-06T23:50:12Z</dc:date>
    <item>
      <title>proc model : vector of restrictions</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/830268#M4491</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I run a non-linear regression using proc model. Proc model as you know have two options of restrictions on parameters: bound and restrict.&lt;/P&gt;&lt;P&gt;I have almost same restriction that returns 100 times, for example :&lt;/P&gt;&lt;P&gt;x1*x2*a+x3*b*t = k(t), when t=0.25,0.5,0.75,....,25 and k is fixed(number) for each t. i.e each t has different k&lt;/P&gt;&lt;P&gt;x1, x2, x3 - parameters&lt;/P&gt;&lt;P&gt;It looks like :&lt;/P&gt;&lt;P&gt;x1*x2*a+x3*b*0.25 = 60&lt;/P&gt;&lt;P&gt;x1*x2*a+x3*b*0.5 = 75&lt;/P&gt;&lt;P&gt;x1*x2*a+x3*b*0.75 = 79&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Is there any way to write these restrictions in proc model in one restrict? Maybe put t and k into&amp;nbsp; a dataset, that i could take the values from there?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 12:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/830268#M4491</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2022-08-25T12:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc model : vector of restrictions</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/830900#M4496</link>
      <description>&lt;P&gt;Yes. You can specify multiple restrictions by separating them with commas on the RESTRICT statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;restrict x1*x2*a+x3*b*0.25 = 60,
   x1*x2*a+x3*b*0.5 = 75,
   x1*x2*a+x3*b*0.75 = 79;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, you may be interested in using PROC TMODEL to estimate your model. PROC TMODEL uses the same syntax as PROC MODEL, but it has an improved non-linear optimization engine that is well suited to problems with nonlinear restrictions.&lt;/P&gt;
&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 14:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/830900#M4496</guid>
      <dc:creator>kessler</dc:creator>
      <dc:date>2022-08-29T14:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc model : vector of restrictions</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/831709#M4500</link>
      <description>Of course, i can write these restrictions, but it not looks nice to write 100 restrictions, therefore i asked a question if there are any other way to write these restriction in more "normal" way.</description>
      <pubDate>Sun, 04 Sep 2022 11:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/831709#M4500</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2022-09-04T11:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc model : vector of restrictions</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/832066#M4501</link>
      <description>&lt;P&gt;Alexey,&lt;/P&gt;
&lt;P&gt;If you want to programmatically generate your list of restrictions then you can use the SAS macro language.&amp;nbsp; Here's an example that shows how a RESTRICT statement could be generated from values stored in a data set.&lt;/P&gt;
&lt;P&gt;Marc&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
   do t = 2 to 12 by 2;
	   output;
	end;
run;

data _null_;
   length eqs $ 1024;
   set d;
	eqname = 'eq'||left(put(_n_,6.));
	call symput(eqname, "lhs = " || t);
run;


%macro restricts;
   restrict
   %do i = 1 %to 6; 
		%unquote(&amp;amp;eq&amp;amp;i)
		%if &amp;amp;i ne 6 %then,
   %end;
	;
%mend restricts; 


proc tmodel;&lt;BR /&gt;   ... your model code  ... 
   %restricts;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Sep 2022 23:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-model-vector-of-restrictions/m-p/832066#M4501</guid>
      <dc:creator>kessler</dc:creator>
      <dc:date>2022-09-06T23:50:12Z</dc:date>
    </item>
  </channel>
</rss>

