<?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: single and double integration of a multivariable function in SAS in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899713#M6101</link>
    <description>&lt;P&gt;Dear Dr Rick&lt;/P&gt;&lt;P&gt;as you suggested i gave a starting value for the rho matrix and included rho in the global statement. still got errors stating that starting values for w and v were not given. So i inserted starting values for w and v. still got errors. I am perplexed. Note that w and v should be functions not constants.&lt;/P&gt;&lt;P&gt;here is the log:&lt;/P&gt;&lt;P&gt;249 proc iml;/*double integration for weighted polychoric correlation*/&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;250 start inner(y) global(rho);&lt;BR /&gt;251 return(exp(-.5*x#x/(1-rho**2))#exp(-.5*y#y+rho#x#y/(1-rho**2))) ;&lt;BR /&gt;252 finish;&lt;BR /&gt;NOTE: Module INNER defined.&lt;BR /&gt;253 start outer(x) global(rho);&lt;BR /&gt;254 rho=j(1,2,.5);&lt;BR /&gt;255 w=j(1,2,.);&lt;BR /&gt;256 v=j(1,2,.);&lt;BR /&gt;257 *w =exp(-.5*x#x/(1-rho**2)) ;&lt;BR /&gt;258 yinterval = 1.5 || 3;&lt;BR /&gt;259 /** evaluate inner integral for the function in x **/&lt;BR /&gt;260 *w=exp(-.5*x#x/(1-rho**2));&lt;BR /&gt;261 call quad(w, "inner", yinterval);&lt;BR /&gt;262 return (w);&lt;BR /&gt;263 finish;&lt;BR /&gt;NOTE: Module OUTER defined.&lt;BR /&gt;264 print w;&lt;BR /&gt;ERROR: Matrix w has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 264 column 1&lt;BR /&gt;265 xinterval= {1 2.6};&lt;BR /&gt;266 call quad(v, "outer", xinterval);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : * at line 251 column 18&lt;BR /&gt;operands : _TEM1001, x&lt;/P&gt;&lt;P&gt;_TEM1001 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;-0.5&lt;/P&gt;&lt;P&gt;x 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : RETURN at line 251 column 4&lt;BR /&gt;traceback : module INNER at line 251 column 4&lt;BR /&gt;module OUTER at line 253 column 2&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(1.5 , 3 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 261 column 4&lt;BR /&gt;operands : *LIT1018, yinterval&lt;/P&gt;&lt;P&gt;*LIT1018 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;inner&lt;/P&gt;&lt;P&gt;yinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;1.5 3&lt;/P&gt;&lt;P&gt;statement : CALL at line 261 column 4&lt;BR /&gt;traceback : module OUTER at line 261 column 4&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(1 , 2.6 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 266 column 1&lt;BR /&gt;operands : *LIT1020, xinterval&lt;/P&gt;&lt;P&gt;*LIT1020 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;outer&lt;/P&gt;&lt;P&gt;xinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;1 2.6&lt;/P&gt;&lt;P&gt;statement : CALL at line 266 column 1&lt;BR /&gt;266! /** outer integral **/&lt;BR /&gt;267 print v;&lt;BR /&gt;ERROR: Matrix v has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 267 column 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 05:19:23 GMT</pubDate>
    <dc:creator>hrmannan</dc:creator>
    <dc:date>2023-10-24T05:19:23Z</dc:date>
    <item>
      <title>single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899545#M6095</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have been trying to singly and doubly integrate multivariable functions using the quad routine in SAS IML but getting errors. the integration domain is finite. The result should be a function of rho rather than a constant. Here is the log file for double integration. i am concerned about the error 'the matrix has not been set to a value'.&amp;nbsp; i dont know how to assign the optional command for mean and std dev of the vector as suggested. both x and y are bivariate N(0,1) variates, r is the weighted polychoric correlation and is unknown. i can increase the integration domain length for convergence if needed. please help to debugg the errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0 proc iml;/*double integration for weighted polychoric correlation*/&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;101 start inner(y) global(a);&lt;BR /&gt;102 return(a#exp(-.5*y#y+rho#x#y/(1-rho**2))) ;&lt;BR /&gt;103 finish;&lt;BR /&gt;NOTE: Module INNER defined.&lt;BR /&gt;104 start outer(x) global(a);&lt;BR /&gt;105 a =exp(-.5*x#x/(1-rho**2)) ;&lt;BR /&gt;106 yinterval = 1.5 || 3;&lt;BR /&gt;107 /** evaluate inner integral for the function in x **/&lt;BR /&gt;108 w=exp(-.5*x#x/(1-rho**2));&lt;BR /&gt;109 call quad(w, "inner", yinterval);&lt;BR /&gt;110 return (w);&lt;BR /&gt;111 finish;&lt;BR /&gt;NOTE: Module OUTER defined.&lt;BR /&gt;112 print w;&lt;BR /&gt;ERROR: Matrix w has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 112 column 1&lt;BR /&gt;113 xinterval= {1 2.6};&lt;BR /&gt;114 call quad(v, "outer", xinterval);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : ** at line 105 column 1&lt;BR /&gt;operands : rho, *LIT1006&lt;/P&gt;&lt;P&gt;rho 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*LIT1006 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;statement : ASSIGN at line 105 column 1&lt;BR /&gt;traceback : module OUTER at line 105 column 1&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(1 , 2.6 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case you can change the independent variable&lt;BR /&gt;in the integrand, or, provide the optional vector describing roughly the mean and the standard deviation of the&amp;nbsp;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 114 column 1&lt;BR /&gt;operands : *LIT1014, xinterval&lt;/P&gt;&lt;P&gt;*LIT1014 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;outer&lt;/P&gt;&lt;P&gt;xinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;1 2.6&lt;/P&gt;&lt;P&gt;statement : CALL at line 114 column 1&lt;BR /&gt;114! /** outer integral **/&lt;BR /&gt;115 print v;&lt;BR /&gt;ERROR: Matrix v has not been set to a value.&amp;nbsp;statement : PRINT at line 115 column 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's the log for the single integration. the answer should be a function of rho and z. y and z are bivariate standard normal variates.&lt;/P&gt;&lt;P&gt;6 proc iml;&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;117 start inner(y) global(a);&lt;BR /&gt;118 return(exp(-0.5*(y-rho#z)##2/(1-rho##2)));&lt;BR /&gt;119 finish;&lt;BR /&gt;NOTE: Module INNER defined.&lt;BR /&gt;120&lt;BR /&gt;121 /** evaluate integral for the parameter value, a=3 **/&lt;BR /&gt;122 a = 3;&lt;BR /&gt;123 yinterval = 1.5 || a;&lt;BR /&gt;124 call quad(w, "inner", yinterval);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : # at line 118 column 26&lt;BR /&gt;operands : rho, z&lt;/P&gt;&lt;P&gt;rho 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;z 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : RETURN at line 118 column 4&lt;BR /&gt;traceback : module INNER at line 118 column 4&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(1.5 , 3 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 124 column 1&lt;BR /&gt;operands : *LIT1007, yinterval&lt;/P&gt;&lt;P&gt;*LIT1007 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;inner&lt;/P&gt;&lt;P&gt;yinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;1.5 3&lt;/P&gt;&lt;P&gt;statement : CALL at line 124 column 1&lt;BR /&gt;125 print w;&lt;BR /&gt;ERROR: Matrix w has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 125 column 1&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2023 00:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899545#M6095</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-22T00:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899562#M6096</link>
      <description>&lt;P&gt;&amp;gt; ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;
&lt;P&gt;&amp;gt; rho 0 row 0 col (type ?, size 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In both integrands, you have not defined the RHO variable. This information is in the log, so please read the error messages. Add RHO to the GLOBAL statement and give RHO a value somewhere in the program.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2023 10:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899562#M6096</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-22T10:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899565#M6097</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/459042"&gt;@hrmannan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also ... next time you put extracts from the LOG-window in your Communities post ...&lt;/P&gt;
&lt;P&gt;Click the "Insert Code" icon ( &amp;lt;/&amp;gt; ) in the header bar and copy / paste your log in the pop-up window!&lt;/P&gt;
&lt;P&gt;That makes your post much more readable!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2023 13:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899565#M6097</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-22T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899571#M6098</link>
      <description />
      <pubDate>Sun, 22 Oct 2023 19:08:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899571#M6098</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-22T19:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899573#M6099</link>
      <description>Dear Dr Rick&lt;BR /&gt;Rho is unknown in my case because I want to estimate it following the double integration. Can quad still be used to find the function which I need to maximise?</description>
      <pubDate>Sun, 22 Oct 2023 19:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899573#M6099</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-22T19:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899620#M6100</link>
      <description>&lt;P&gt;Yes, I know that RHO is not known. But optimization works by evaluating the objective function at values of RHO, then iterating towards the value that optimizes the objective. To do that, you must be able to evaluate the function for any value of RHO.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For an example of optimizing a function that requires evaluating an integral, see&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2014/03/05/optimizing-a-function-that-evaluates-an-integral.html#:~:text=You%20can%20use%20SAS%2FIML%20software%20to%20optimize%20a,QUAD%20function.%20You%20can%20constrain%20the%20parameter%20values." target="_blank"&gt;Optimizing a function that evaluates an integral - The DO Loop (sas.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 10:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899620#M6100</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-23T10:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899713#M6101</link>
      <description>&lt;P&gt;Dear Dr Rick&lt;/P&gt;&lt;P&gt;as you suggested i gave a starting value for the rho matrix and included rho in the global statement. still got errors stating that starting values for w and v were not given. So i inserted starting values for w and v. still got errors. I am perplexed. Note that w and v should be functions not constants.&lt;/P&gt;&lt;P&gt;here is the log:&lt;/P&gt;&lt;P&gt;249 proc iml;/*double integration for weighted polychoric correlation*/&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;250 start inner(y) global(rho);&lt;BR /&gt;251 return(exp(-.5*x#x/(1-rho**2))#exp(-.5*y#y+rho#x#y/(1-rho**2))) ;&lt;BR /&gt;252 finish;&lt;BR /&gt;NOTE: Module INNER defined.&lt;BR /&gt;253 start outer(x) global(rho);&lt;BR /&gt;254 rho=j(1,2,.5);&lt;BR /&gt;255 w=j(1,2,.);&lt;BR /&gt;256 v=j(1,2,.);&lt;BR /&gt;257 *w =exp(-.5*x#x/(1-rho**2)) ;&lt;BR /&gt;258 yinterval = 1.5 || 3;&lt;BR /&gt;259 /** evaluate inner integral for the function in x **/&lt;BR /&gt;260 *w=exp(-.5*x#x/(1-rho**2));&lt;BR /&gt;261 call quad(w, "inner", yinterval);&lt;BR /&gt;262 return (w);&lt;BR /&gt;263 finish;&lt;BR /&gt;NOTE: Module OUTER defined.&lt;BR /&gt;264 print w;&lt;BR /&gt;ERROR: Matrix w has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 264 column 1&lt;BR /&gt;265 xinterval= {1 2.6};&lt;BR /&gt;266 call quad(v, "outer", xinterval);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : * at line 251 column 18&lt;BR /&gt;operands : _TEM1001, x&lt;/P&gt;&lt;P&gt;_TEM1001 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;-0.5&lt;/P&gt;&lt;P&gt;x 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : RETURN at line 251 column 4&lt;BR /&gt;traceback : module INNER at line 251 column 4&lt;BR /&gt;module OUTER at line 253 column 2&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(1.5 , 3 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 261 column 4&lt;BR /&gt;operands : *LIT1018, yinterval&lt;/P&gt;&lt;P&gt;*LIT1018 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;inner&lt;/P&gt;&lt;P&gt;yinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;1.5 3&lt;/P&gt;&lt;P&gt;statement : CALL at line 261 column 4&lt;BR /&gt;traceback : module OUTER at line 261 column 4&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(1 , 2.6 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 266 column 1&lt;BR /&gt;operands : *LIT1020, xinterval&lt;/P&gt;&lt;P&gt;*LIT1020 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;outer&lt;/P&gt;&lt;P&gt;xinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;1 2.6&lt;/P&gt;&lt;P&gt;statement : CALL at line 266 column 1&lt;BR /&gt;266! /** outer integral **/&lt;BR /&gt;267 print v;&lt;BR /&gt;ERROR: Matrix v has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 267 column 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 05:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899713#M6101</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-24T05:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899730#M6102</link>
      <description>&lt;P&gt;You marked my post as the solution (a while ago), even though it actually has nothing to do with the original question on your part. That makes it all the stranger that you still don't follow the recommendation I put in there.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Namely:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;While editing your post / reply ... Click the "Insert Code" icon ( &amp;lt;/&amp;gt; ) in the header bar and copy / paste your log in the pop-up window!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;That makes your LOG-messages much more readable for us!&lt;BR /&gt;&lt;BR /&gt;It's not that problematic of course, but try to think about it next time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 08:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899730#M6102</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-24T08:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899782#M6103</link>
      <description>&lt;P&gt;I think you need to study some of the online examples of using the QUAD function. RHO should be defined outside of all functions and x in the outer function must be provided as a global variable to the inner function. In your program, you have defined RHO to be a (1 x 2) vector. It should be a scalar. You have not provided the x value to the inner integral.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could show you how to do this, but I think your&amp;nbsp;&lt;SPAN&gt;program has a lot of other problems that need to be addressed. I think you need to carefully think about what you are trying to do. Here are a few things that seem strange to me:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1) An MLE estimate uses data to fit the parameters of the model. You have no data.&lt;/P&gt;
&lt;P&gt;2) You are integrating the bivariate normal PDF over the region [1, 2.5] x [1.5, 3]. I don't think this integral has a maximum value as a function of rho. I think the integral approaches infinity as rho -&amp;gt; 1.&lt;/P&gt;
&lt;P&gt;3) You are integrating the density (PDF), not the log-PDF. Yet, you keep talking about MLE. In computational statistics, we use the log-likelihood because the LOG-PDF is better behaved, numerically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please use the SAS Support Communities to discuss programming problems. I see that you posted the same questions to my blog, but the blogging software is not very good for discussing programming issues or for having back-and-forth discussions.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 13:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/899782#M6103</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-24T13:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900561#M6104</link>
      <description>&lt;P&gt;dear Dr Rick&lt;/P&gt;&lt;P&gt;my intention is to find the result of the multivariable double integral which should be a function of rho so that i can maximize it in order to get a MLE of rho. i have followed your advise and have given a starting value for rho before the inner and outer integrals and have given a starting value for x.&amp;nbsp; i only get the result for outer integral v which is a function of x but not for the multivariable function w of x and y. here is the sas log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;249 proc iml;/*double integration for weighted polychoric correlation*/&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;250 rho={.5};&lt;BR /&gt;251 x={1,1,.6};&lt;BR /&gt;252 start inner(y) global(rho);&lt;BR /&gt;253 return(a#exp(-.5#y#y+rho#x#y/(1-rho##2))) ;&lt;BR /&gt;254 finish;&lt;BR /&gt;NOTE: Module INNER defined.&lt;BR /&gt;255 rho={.5};&lt;BR /&gt;256 w={.};&lt;BR /&gt;257&lt;BR /&gt;258 start outer(x) global(rho);&lt;BR /&gt;259 *w =exp(-.5#x#x/(1-rho##2)) ;&lt;BR /&gt;260 a=exp(-.5#x#x/(1-rho##2));&lt;BR /&gt;261 yinterval = .5 || .9;&lt;BR /&gt;262 /** evaluate inner integral for the function in x **/&lt;BR /&gt;263 *w=exp(-.5*x#x/(1-rho**2));&lt;BR /&gt;264 call quad(w, "inner", yinterval);&lt;BR /&gt;265 return (w);&lt;BR /&gt;266 finish;&lt;BR /&gt;NOTE: Module OUTER defined.&lt;BR /&gt;267 print w;&lt;BR /&gt;268 v={.};&lt;BR /&gt;269 xinterval= {.5 .95};&lt;BR /&gt;270 v=exp(-.5#x#x/(1-rho##2));&lt;BR /&gt;271 call quad(v, "outer", xinterval);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : # at line 253 column 28&lt;BR /&gt;operands : rho, x&lt;/P&gt;&lt;P&gt;rho 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;0.5&lt;/P&gt;&lt;P&gt;x 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : RETURN at line 253 column 4&lt;BR /&gt;traceback : module INNER at line 253 column 4&lt;BR /&gt;module OUTER at line 258 column 2&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(0.5 , 0.9 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 264 column 4&lt;BR /&gt;operands : *LIT1013, yinterval&lt;/P&gt;&lt;P&gt;*LIT1013 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;inner&lt;/P&gt;&lt;P&gt;yinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;0.5 0.9&lt;/P&gt;&lt;P&gt;statement : CALL at line 264 column 4&lt;BR /&gt;traceback : module OUTER at line 264 column 4&lt;/P&gt;&lt;P&gt;Convergence could not be attained over the subinterval&lt;BR /&gt;(0.5 , 0.95 )&lt;/P&gt;&lt;P&gt;The function might have one of the following:&lt;BR /&gt;1) A slowly convergent or a divergent integral.&lt;BR /&gt;2) Strong oscillations.&lt;BR /&gt;3) A small scale in the integrand: in this case&lt;BR /&gt;you can change the independent variable&lt;BR /&gt;in the integrand, or,&lt;BR /&gt;provide the optional vector describing roughly&lt;BR /&gt;the mean and the standard deviation of the&lt;BR /&gt;integrand&lt;BR /&gt;4) Points of discontinuities in the interior&lt;BR /&gt;in this case, you can provide a vector containing&lt;BR /&gt;the points of discontinuity and try again.&lt;/P&gt;&lt;P&gt;ERROR: Execution error as noted previously. (rc=100)&lt;/P&gt;&lt;P&gt;operation : QUAD at line 271 column 1&lt;BR /&gt;operands : *LIT1019, xinterval&lt;/P&gt;&lt;P&gt;*LIT1019 1 row 1 col (character, size 5)&lt;/P&gt;&lt;P&gt;outer&lt;/P&gt;&lt;P&gt;xinterval 1 row 2 cols (numeric)&lt;/P&gt;&lt;P&gt;0.5 0.95&lt;/P&gt;&lt;P&gt;statement : CALL at line 271 column 1&lt;BR /&gt;271! /** outer integral **/&lt;BR /&gt;272 print v;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 02:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900561#M6104</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-30T02:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900580#M6105</link>
      <description>&lt;P&gt;in continuation note that i just sent the log file showing the errors. please note that i am still in the first part of my objective which is to find the outcome of the double integral which should be a function of rho. i havent tried to maximise it yet because i havent been able to find the function which i need to maximise.&lt;/P&gt;&lt;P&gt;Haider&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 06:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900580#M6105</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-30T06:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900610#M6106</link>
      <description>&lt;P&gt;Currently, this problem is marked as "Solved". If your problem is not solved, you might want to change the solution status so that more experts will read the thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 09:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900610#M6106</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-30T09:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900654#M6110</link>
      <description>There are two posts on the topic. The problem isn’t solved so please respond with a solution&lt;BR /&gt;Haider Mannan&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Oct 2023 11:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900654#M6110</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-30T11:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900677#M6113</link>
      <description>&lt;P&gt;This program is based on your second example. the program shows the correct way to evaluate a double integral for the function that you have defined and over the range of integration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* double integration for weighted polychoric correlation */
proc iml;
start inner(y) global(g_x, rho);
   x = g_x;
   return(exp(-.5*x#x/(1-rho**2))#exp(-.5*y#y+rho#x#y/(1-rho**2))) ;
finish;

/* TEST THE INNER MODULE */
rho=0.5;                 /* global value of RHO */
g_x = 0;                 /* for testing: evaluate inner integral when x=g_x */
yinterval = {1.5  3};
call quad(z, "inner", yinterval);
print z;
free g_x;                /* undefine g_x; it'll be set in the OUTER module */

/* g_x is the global variable that holds the value of x for the outer integral.
   This is a constant when we evaluate the inner integral. */
start outer(x) global(g_x, rho);  
   g_x = x;   /* save copy of x so the inner integral can use it */
   yinterval = 1.5 || 3;
   /* evaluate w = inner integral when x is held constant */
   call quad(w, "inner", yinterval);
   return (w);
finish;

/* TEST THE OUTER MODULE */
xinterval= {1 2.6};
call quad(v, "outer", xinterval);
print v;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2023 13:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900677#M6113</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-30T13:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900854#M6114</link>
      <description>&lt;P&gt;Dear Dr Rick&lt;/P&gt;&lt;P&gt;thank you very much. it produced a constant value for the integrand. however, i need the integrand as a function of rho in order to maximise it using my data weights (survey). the log-likelihood is-&lt;/P&gt;&lt;P&gt;sum(weights*log(integrand))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried with nlpnra subroutine but dont know how to access the data. kindly let me know.&lt;/P&gt;&lt;P&gt;Haider&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 06:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900854#M6114</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-10-31T06:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900896#M6115</link>
      <description>&lt;P&gt;Please post the program you have written. That will enable us to suggest modifications.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 12:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/900896#M6115</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-31T12:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/901063#M6116</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;&amp;nbsp;it produced a constant value for the integrand. however, i need the integrand as a function of rho&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;No, the program I posted is a function of rho. You can see how the function changes by plotting the&amp;nbsp;double integral versus rho:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rhoVals = do(-0.9, 0.6, 0.05);
IntegVals = j(1, ncol(rhoVals), .);
do i = 1 to ncol(rhoVals);
   rho = rhoVals[i];
   call quad(v, "outer", xinterval);
   IntegVals[i] = v;
end;

title "Double Integral as a Function of rho";
call series(rhoVals, IntegVals) grid={x y};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot45.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89308i9ABB26BE2460888D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot45.png" alt="SGPlot45.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I have previously explained, this function is unbounded as rho -&amp;gt; +1. Therefore, it has no maximum on the interval (-1, 1).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a reference for the MLE equations for weighted polychoric correlation?&amp;nbsp; Perhaps you copied an equation incorrectly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 12:51:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/901063#M6116</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-11-01T12:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/901537#M6117</link>
      <description>&lt;P&gt;dear Dr. Rick&lt;/P&gt;&lt;P&gt;maybe I didnt send the full link for the R doc on calculating weighted polychoric correlation. here it is-&lt;/P&gt;&lt;P&gt;file://ad.uws.edu.au/dfshare/HomesCMB$/30043787/My%20Documents/Phillipa's%20ABS%20data%20based%20study%20aug%202022/wCorr%20Formulas%20%E2%80%A2%20wCorr.html&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 07:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/901537#M6117</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-11-04T07:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/902254#M6118</link>
      <description>&lt;P&gt;Dear Dr Rick&lt;/P&gt;&lt;P&gt;the methodology for estimating weighted polychoric correlation taken from the doc&lt;/P&gt;&lt;P&gt;written by&amp;nbsp;Paul Bailey, Ahmad Emad, Ting Zhang, Qingshu Xie,Source:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/American-Institutes-for-Research/wCorr/blob/HEAD/vignettes/wCorrFormulas.Rmd" target="_blank" rel="noopener"&gt;&lt;CODE&gt;vignettes/wCorrFormulas.Rmd.&lt;/CODE&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;the link for the doc is-&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://american-institutes-for-research.github.io/wCorr/articles/wCorrFormulas.html" target="_blank" rel="noopener"&gt;https://american-institutes-for-research.github.io/wCorr/articles/wCorrFormulas.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;i couldnt paste the formulas as the format is not readable.&amp;nbsp; kindly see where i went wrong with the formulas . First the double integral of a bivariate normal density over finite limits (both are proportions so below 1) has to be solved and then the loglikelihood is to be maximized, the log likelihood is-&lt;/P&gt;&lt;P&gt;=sum(weights*log of the double integral)&lt;/P&gt;&lt;P&gt;you showed that this double integral doesnt converge. then where is the error.&lt;/P&gt;&lt;P&gt;looking forward to your kind help.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Haider Mannan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 04:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/902254#M6118</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-11-09T04:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: single and double integration of a multivariable function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/902903#M6119</link>
      <description>&lt;P&gt;Dear Dr Rick&lt;/P&gt;&lt;P&gt;the methodology for estimating weighted polychoric correlation taken from the doc&lt;/P&gt;&lt;P&gt;written by&amp;nbsp;Paul Bailey, Ahmad Emad, Ting Zhang, Qingshu Xie,Source:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/American-Institutes-for-Research/wCorr/blob/HEAD/vignettes/wCorrFormulas.Rmd" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;CODE&gt;vignettes/wCorrFormulas.Rmd.&lt;/CODE&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;the link for the doc is-&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://american-institutes-for-research.github.io/wCorr/articles/wCorrFormulas.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://american-institutes-for-research.github.io/wCorr/articles/wCorrFormulas.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;i couldnt paste the formulas as the format is not readable.&amp;nbsp; kindly see where i went wrong with the formulas . First the double integral of a bivariate normal density over finite limits (both are proportions so below 1) has to be solved and then the loglikelihood is to be maximized, the log likelihood is-&lt;/P&gt;&lt;P&gt;=sum(weights*log of the double integral)&lt;/P&gt;&lt;P&gt;you showed that this double integral doesnt converge. then where is the error.&lt;/P&gt;&lt;P&gt;looking forward to your kind help.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Haider Mannan&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 01:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/single-and-double-integration-of-a-multivariable-function-in-SAS/m-p/902903#M6119</guid>
      <dc:creator>hrmannan</dc:creator>
      <dc:date>2023-11-14T01:45:13Z</dc:date>
    </item>
  </channel>
</rss>

