0

Can anyone help me? My code has some warnings. How can I solve these problems? Input is a simple vector 1*196608 that is extracted from Matlab.

warnings:

1: In empirical.distribution$dist.freq - benford.dist.freq :
  longer object length is not a multiple of shorter object length

2: In ((empirical.distribution$dist.freq - benford.dist.freq)^2)/benford.dist.freq :
  longer object length is not a multiple of shorter object length

3: In empirical.distribution$dist - benford.dist :
  longer object length is not a multiple of shorter object length

4: In as.data.table.list(x, keep.rownames = keep.rownames,  ... :
  Item 1 has 9 rows but longest item has 10; recycled with remainder

My code:

library(benford.analysis)
library(R.matlab)
f=readMat('vectorimage.mat')
s=f$vectorimage
y=as.numeric(s);#convert to numeric type
d=benford(y,number.of.digits = 1)
print(d)
plot(d)
Jovan
  • 763
  • 7
  • 26
Arman
  • 1
  • 5

1 Answers1

1

Based by your data, I think you have negative and positive values both varying in y, which is likely normally distributed, therefore you can modify benford, like this:

benford(y, number.of.digits = 3, sign = "both", discrete=TRUE, round=3)
Jovan
  • 763
  • 7
  • 26