Re: [Scilab-users] ”Too complex recursion”

2015-05-19 Thread Serge Steer
Le 19/05/2015 03:27, fujimoto2005 a écrit :
 When I use the function 'intg', I have an message Too complex recursion!
 (recursion tables are full) and the code stop to run.
 But the user-function for the ‘intg’ calls only two user functions with same
 level in it.
 How can I fix this problem?
 I already maximized the stack seize by stacksize('max').
The Too complex recursion! message has nothing to do with the stack
size. It is often due to a function which calls itself (directly or
indirectly) too deeply.
Does your user function calls 'intg'?

Serge Steer



 --
 View this message in context: 
 http://mailinglists.scilab.org/Too-complex-recursion-tp4032303.html
 Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
 Nabble.com.
 ___
 users mailing list
 users@lists.scilab.org
 http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ”Too complex recursion”

2015-05-19 Thread fujimoto2005
Hello,Serge Steer

My user function does't call 'intg'.
The following is a sample code for a demo.
But I have another error message.


clear 
function rt=payoffFunc(fxSpot,fxTriger,fxFixed)
if fxSpot=10 then
fxSpot=10
end
rt=(fxFixed -fxSpot)
if fxSpot = fxTriger then
   rt=(fxSpot -(fxTriger^2)/fxSpot)*3
end
endfunction

function rt=payoffDenFunc(x,t,fxValDate,fxTriger,fxFixed,mu,vol)
f1=fxValDate*%e^x;
pl=payoffFunc(f1,fxTriger,fxFixed);
vrt=t^0.5*vol;
z=(x-mu)/vrt;
dens=1/(sqrt(2*%pi))*%e^(-0.5*z^2)/vrt;
rt=pl*dens;
endfunction

vol=0.09
fxTriger=95
fxFixed=150
fxValDate=100
payD_V=0.0602739726027397

discY_V=0.999747607575612
discD_V=0.996743237517026
mu=log(discD_V/discY_V)/payD_V;

xTrig_V=log(fxTriger./fxValDate) 
xmin_V=(mu-0.5*vol^2)*payD_V-4*vol*sqrt(payD_V)
if xmin_VxTrig_V then
xmin_V=xTrig_V-%eps
end
plCtrlEX1=intg(xmin_V,xTrig_V-%eps,list('payoffDenFunc',payD_V,fxValDate,fxTriger,fxFixed,mu,vol));






--
View this message in context: 
http://mailinglists.scilab.org/Too-complex-recursion-tp4032303p4032306.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ”Too complex recursion”

2015-05-19 Thread sgougeon
Hello,

- Mail original -
.../...
plCtrlEX1=intg(xmin_V,xTrig_V-%eps,list('payoffDenFunc',payD_V,fxValDate,fxTriger,fxFixed,mu,vol));

In the list, you may try specifying directly by its name the function to be 
integrated, rather than through a string giving its name:

plCtrlEX1=intg(xmin_V,xTrig_V-%eps,list(payoffDenFunc,payD_V,fxValDate,fxTriger,fxFixed,mu,vol));

May be the documentation is not clear enough about this point.

Regards

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] ”Too complex recursion”

2015-05-18 Thread fujimoto2005
When I use the function 'intg', I have an message Too complex recursion!
(recursion tables are full) and the code stop to run.
But the user-function for the ‘intg’ calls only two user functions with same
level in it.
How can I fix this problem?
I already maximized the stack seize by stacksize('max').




--
View this message in context: 
http://mailinglists.scilab.org/Too-complex-recursion-tp4032303.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users