Summary
I'm trying to test an RNG which generates numbers to a text file, ideally using decimal numbers between 0 and 1. This using the Rdieharder package.(Note this is my first time using R or any rng test for that matter)
Trying
I am aware of the existence of rng = file_input and file_input_raw functions. All my attempts to run binary or decimal numbers in text files through them has been unsuccessful. Either resulting in fatal errors which freeze Rstudio or as following (image). Plot binary attempt
Code
My attempts look like this in Rstudio.
library(RDieHarder)
library(random)
dh <- dieharder(rng = "file_input_raw", inputfile = "Random.txt")
plot(dh)
I have tried different approaches to formatting the text file.
Binary
32 bit binary numbers as follows:
111000010100001100011011110010
1110000100111111011001011011001
11100001001110111001100100100111
111111101001011010100100000111
....
2,500,000 numbers
This results in following Plot binary attempt. This seems like the program recognizes my input as being 0.
Decimal
0.667371
0.673781
0.663682
0.684186
0.642766
0.726927
0.556512
...
1000 numbers
This freezes Rstudio for both "file_input" and "file_input_raw".
The numbers aren't indicative of final results For the moment I am just trying to get a meaningful result from dieharder. Is my formatting wrong or do I need a different rng= ? Or does anyone know a simple way to use rdieharder on a text file ?
Aucun commentaire:
Enregistrer un commentaire