PieterjanRobbe / GaussianRandomFields.jl

A package for Gaussian random field generation in Julia
Other
66 stars 11 forks source link

Negative eigenvalue for KL creates ''cannot document expression'' error #17

Closed jbmuir closed 4 years ago

jbmuir commented 4 years ago

The warning for negative eigenvalues occasionally fails for me for the KL generator, creating the following:

cannot document the following expression:

"Gaussian random field will be approximated (ignoring all negative eigenvalues)"

An example that creates the error:

x = 0:10:250
z = 0:1:50
lx = 500.0 #characteristic x length
lz = 5.0 #characteristic z length
vσ = 25.0 # characteristic perturbation
A = [1/lz^2 0; 0 1/lx^2]

vcov = CovarianceFunction(2, AnisotropicExponential(A, σ=vσ))
vgrf = GaussianRandomField(vcov, KarhunenLoeve(75), z, x)
ev = sample(vgrf)
PieterjanRobbe commented 4 years ago

It appears to be a wrong multiline warning:

https://github.com/PieterjanRobbe/GaussianRandomFields.jl/blob/d92086e02d62bd841a317adde0f39c8764971323/src/generators/karhunen_loeve.jl#L115-L116

This should now be fixed in the master branch with 7e8720faa8282656478dba74a6401292d9ccd4bc. Could you maybe check if the issue persists with the latest version? Thanks!

jbmuir commented 4 years ago

Seems to work for me! Sorry about taking a bit to get back

PieterjanRobbe commented 4 years ago

No worries, thanks! I'll close the issue.