[Scilab-users] int2d

classic Classic list List threaded Threaded
3 messages Options
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] int2d

In order to calculate the expected value of a certain two-variable function,
I have created a density function of two-dimensional normal distribution.
I created a code like the attached file to check the correctness of the
function, but it does not work.
Where is the code wrong?

I have been confirmed int2D supports list format for a function call.
Furthermore running the code doesn't show "called multNormDensFunc1".
This means it fails to call "multNormDensFunc" function.
 
Best regards.

test_multNorm.sce
<http://mailinglists.scilab.org/file/t497065/test_multNorm.sce>  



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: int2d

Hello Masahiro,

> function rt=multNormDensFunc(x_V, m_V, cov_M);
I am not sure about the semi-colon... ?

> [I2,e]=int2d(X,Y,list(multNormDensFunc,[0,0],[1,0;0,1]),[0.0001, 1, 20*20, 4000, 0])

The function expects only one parameter after both 2D operands x_V, m_V, while the list provides 2 parameters.
So either the function is missing a y_V, or the list has an extra parameter.
I don't know how int2d() manages this.

In practical, int2d() needs mesh2d() to build and feed its X and Y arguments.
While mesh2d() is still an external function in the Metanet module,
that is not Scilab 6 - ready: https://atoms.scilab.org/toolboxes/metanet
...
However, mesh_2() from the CGLAB module https://atoms.scilab.org/toolboxes/cglab
should also be able to do the job (hoping that the output is int2d() compatible).

These tools should be inside Scilab, or int2d() outsite :
http://bugzilla.scilab.org/8284

For int3d(), it is even worse. I am not sure there is any mesh3d() available at all anywhere for Scilab.

Samuel

Le 28/02/2018 à 23:17, fujimoto2005 a écrit :
In order to calculate the expected value of a certain two-variable function,
I have created a density function of two-dimensional normal distribution.
I created a code like the attached file to check the correctness of the
function, but it does not work.
Where is the code wrong?

I have been confirmed int2D supports list format for a function call.
Furthermore running the code doesn't show "called multNormDensFunc1".
This means it fails to call "multNormDensFunc" function.
 
Best regards.

test_multNorm.sce
<http://mailinglists.scilab.org/file/t497065/test_multNorm.sce>  



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

Re: int2d

Hi Samuel

I fixed it as you pointed out and it worked.
There was another mistake. I misunderstood the function len () of another
language as size () and used it.

Was mesh2d internalized? I have not downloaded the Metanet module, but int2d
worked fine.

I have not used the ATOMS yet, but I will try using it little by little.
Are there any guides that wrote the whole picture?

Best regards
test_biv.sce <http://mailinglists.scilab.org/file/t497065/test_biv.sce>  



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users