Re: [Scilab-users] {EXT} Can you suggest a more efficient procedure for generating random variables?

2019-03-18 Thread Heinz Nabielek
I am happy to write a 1.5 page technical   note. What would we do with it 

Greetings from Heinz

> On 18.03.2019, at 17:27, Claus Futtrup  wrote:
> 
> Hi there
> 
> Interesting ...
> 
> If this is excellent for Monte-Carlo simulations, I wish that such an example 
> is put into the documentation. Lots of people (who need Monte-Carlo) would 
> then accidentally fall over it and take advantage of it.
> 
> Cheers,
> Claus
> 
>> On 18.03.2019 11:06, Heinz Nabielek wrote:
>> Ingenious. Works with precision. Gigantically fast for a million random 
>> deviates. Ideal for Monte-Carlo simulations.
>> 
>> I had never heard of dsearch* before..
>> Thanks a lot
>> Heinz
>> 
>> 
>> * I wished the Scilab help files would be more readable.
>> 
>>> On 18.03.2019, at 09:50, Dang Ngoc Chan, Christophe 
>>>  wrote:
>>> 
>>> Hello Heinz,
>>> 
 De : Heinz Nabielek
 Envoyé : dimanche 17 mars 2019 23:50
 
 I need to generate random deviates x according to a given cumulative
 distribution y that is available only in tabular form.
 [...]
 for i=1:N;
 x=[x find(y>z(i),1)];
 end;
 
 y is a previously defined table with values monotonically increasing from 
 zero
>>> I guess these are quantiles.
>>> 
>>> I think you can vectorise with something like
>>> 
>>> x = dsearch(z, y)
>>> 
>>> I tried a little bit and it seems to work but I don't know the exact 
>>> application so...
>>> 
>>> HTH
>>> 
>>> --
>>> Christophe Dang Ngoc Chan
>>> Mechanical calculation engineer
>>> 
>>> Public
>>> This e-mail may contain confidential and/or privileged information. If you 
>>> are not the intended recipient (or have received this e-mail in error), 
>>> please notify the sender immediately and destroy this e-mail. Any 
>>> unauthorized copying, disclosure or distribution of the material in this 
>>> e-mail is strictly forbidden.
>>> ___
>>> 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
> 
> 
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> ___
> 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] {EXT} Can you suggest a more efficient procedure for generating random variables?

2019-03-18 Thread Claus Futtrup

Hi there

Interesting ...

If this is excellent for Monte-Carlo simulations, I wish that such an 
example is put into the documentation. Lots of people (who need 
Monte-Carlo) would then accidentally fall over it and take advantage of it.


Cheers,
Claus

On 18.03.2019 11:06, Heinz Nabielek wrote:

Ingenious. Works with precision. Gigantically fast for a million random 
deviates. Ideal for Monte-Carlo simulations.

I had never heard of dsearch* before..
Thanks a lot
Heinz


* I wished the Scilab help files would be more readable.


On 18.03.2019, at 09:50, Dang Ngoc Chan, Christophe  
wrote:

Hello Heinz,


De : Heinz Nabielek
Envoyé : dimanche 17 mars 2019 23:50

I need to generate random deviates x according to a given cumulative
distribution y that is available only in tabular form.
[...]
for i=1:N;
x=[x find(y>z(i),1)];
end;

y is a previously defined table with values monotonically increasing from zero

I guess these are quantiles.

I think you can vectorise with something like

x = dsearch(z, y)

I tried a little bit and it seems to work but I don't know the exact 
application so...

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
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




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [Scilab-users] {EXT} Can you suggest a more efficient procedure for generating random variables?

2019-03-18 Thread Dang Ngoc Chan, Christophe
Hello,

> De : Heinz Nabielek [mailto:heinznabie...@me.com]
> Envoyé : lundi 18 mars 2019 11:07
>
> I had never heard of dsearch* before..

Neither did I :-D

I just couldn't imagine such a feature didn't exist
so I looked at the neighbouring "Search and sort" functions in the help online 
page…

> * I wished the Scilab help files would be more readable...

You're probably right.
I just wonder how in this case.
Maybe adding "dsearch" to the "See also" list at the bottom of the "find" help 
page?

It may deserve a "wishlist" severity on http://bugzilla.scilab.org

Anyway, I'm happy I could be useful to someone today (-:

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} Can you suggest a more efficient procedure for generating random variables?

2019-03-18 Thread Heinz Nabielek
Ingenious. Works with precision. Gigantically fast for a million random 
deviates. Ideal for Monte-Carlo simulations.

I had never heard of dsearch* before..
Thanks a lot
Heinz


* I wished the Scilab help files would be more readable.

> On 18.03.2019, at 09:50, Dang Ngoc Chan, Christophe 
>  wrote:
> 
> Hello Heinz,
> 
>> De : Heinz Nabielek
>> Envoyé : dimanche 17 mars 2019 23:50
>> 
>> I need to generate random deviates x according to a given cumulative
>> distribution y that is available only in tabular form.
>> [...]
>> for i=1:N;
>> x=[x find(y>z(i),1)];
>> end;
>> 
>> y is a previously defined table with values monotonically increasing from 
>> zero
> 
> I guess these are quantiles.
> 
> I think you can vectorise with something like
> 
> x = dsearch(z, y)
> 
> I tried a little bit and it seems to work but I don't know the exact 
> application so...
> 
> HTH
> 
> --
> Christophe Dang Ngoc Chan
> Mechanical calculation engineer
> 
> Public
> This e-mail may contain confidential and/or privileged information. If you 
> are not the intended recipient (or have received this e-mail in error), 
> please notify the sender immediately and destroy this e-mail. Any 
> unauthorized copying, disclosure or distribution of the material in this 
> e-mail is strictly forbidden.
> ___
> 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] {EXT} Can you suggest a more efficient procedure for generating random variables?

2019-03-18 Thread Dang Ngoc Chan, Christophe
Hello Heinz,

> De : Heinz Nabielek
> Envoyé : dimanche 17 mars 2019 23:50
>
> I need to generate random deviates x according to a given cumulative
> distribution y that is available only in tabular form.
> [...]
> for i=1:N;
> x=[x find(y>z(i),1)];
> end;
>
> y is a previously defined table with values monotonically increasing from zero

I guess these are quantiles.

I think you can vectorise with something like

x = dsearch(z, y)

I tried a little bit and it seems to work but I don't know the exact 
application so...

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users