Hi, Shrewd!        Login  
Shrewd'm.com 
A merry & shrewd investing community
Best Of MI | Best Of | Favourites & Replies | All Boards | Post of the Week!
Search MI
Shrewd'm.com Merry shrewd investors
Best Of MI | Best Of | Favourites & Replies | All Boards | Post of the Week!
Search MI


Investment Strategies / Mechanical Investing
Unthreaded | Threaded | Whole Thread (11) |
Author: lizgdal   😊 😞
Number: of 3959 
Subject: Re: Scatter of Dartboard Screen Results
Date: 07/27/2023 10:37 AM
Post New | Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
1. The exact definition of the mod function depends on the programming language. I would guess gtr1 is Floating-point Truncated similar to C fmod.

Using a different random number generator can show if there is a problem. The hash function takes a parameter from 1e-25 to 1e25:

from Excel: param0=10^(50*(RAND()-0.5))
Junk: hash(aprc,dspo(1),param0)

The random number generators using hash and mod have similar SDcg.

        Screen         yrs  Depth  SDcg  SDpop
Dartboard2023c80hash2 66 80 0.42 30
Dartboard2023c80hash4 66 80 0.45 32
Dartboard2023c80hash1 66 80 0.45 33
Dartboard2023c80hash3 66 80 0.46 33

Dartboard2023c80mod4 66 80 0.43 31
Dartboard2023c80mod1 66 80 0.46 33
Dartboard2023c80mod3 66 80 0.46 33
Dartboard2023c80mod2 66 80 0.48 35


https://gtr1.net/2013/?~Dartboard2023c80hash1:h253...
https://gtr1.net/2013/?~Dartboard2023c80hash2:h253...
https://gtr1.net/2013/?~Dartboard2023c80hash3:h253...
https://gtr1.net/2013/?~Dartboard2023c80hash4:h253...
https://gtr1.net/2013/?~Dartboard2023c80mod1:h253n...
https://gtr1.net/2013/?~Dartboard2023c80mod2:h253n...
https://gtr1.net/2013/?~Dartboard2023c80mod3:h253n...
https://gtr1.net/2013/?~Dartboard2023c80mod4:h253n...

The gtr1 glossary says: "the function mod first divides the investment's corresponding value in the field referenced by field_ref by divisor_num and truncates the resulting quotient to an integer; the product of divisor_num and the integral quotient is then subtracted from the investment's value in field_ref and the resulting difference (remainder) is assigned to the investment's value in the calling field."

The highest aprc in the S&P 1500 gtr1 data is now NVR $5235. The highest dspo is 24482. I checked the gtr1 numbers for a stock with a high aprc and high dspo, and the calculation looks correct. The 0.0003 difference is small compared to the 0 to 153 range of RandomA.

RandomA: mod(linear(1,dspo(1),23,aprc,97,trm(1,17)),153)

  ticker   dspo:1    aprc      trm:1,17    wgtSum   [RandomA]
LMT 20960 475.50 0.993621 31992.88 15.8809

manual calc check
dspo:1 23*aprc 97*trm:1,17 wgtSum
wgtSum: 20960 10936.50 96.38 31992.88
quotient 209 153 31977
remainder 15.8812
Post New | Post Reply | Report Post | Recommend It!
Print the post
Unthreaded | Threaded | Whole Thread (11) |


Announcements
Mechanical Investing FAQ
Contact Shrewd'm
Contact the developer of these message boards.

Best Of MI | Best Of | Favourites & Replies | All Boards | Followed Shrewds