Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running the Lorenz 96 Example #152

Closed
benxro opened this issue Apr 26, 2022 · 3 comments
Closed

Error when running the Lorenz 96 Example #152

benxro opened this issue Apr 26, 2022 · 3 comments
Assignees

Comments

@benxro
Copy link

benxro commented Apr 26, 2022

I made a fresh installation of Julia 1.7.2 on Ubuntu 20.04. Cloned the repository, then followed the installation instructions.
Running the test cases works without issues, passing 340 of 340 tests.
I cd into the directory of /EnsembleKalmanProcesses.jl/examples/Lorenz/.
The documentation under 'Examples - Lorenz' advises:

The L96 parameter estimation can be run using julia --project Lorenz_example.jl

After resolving all missing packages and executing the mentioned command, I receive the following error:

$ julia --project Lorenz_example.jl 

/home/ben/some_path/EnsembleKalmanProcesses.jl/examples/Lorenz
2
[8.0; 2.5;;]
ERROR: LoadError: MethodError: no method matching ParameterDistribution(::Vector{Dict{String, Any}})
Closest candidates are:
  ParameterDistribution(::Union{Array{PDType}, PDType}, ::Union{Array{CType}, Array, CType}, ::Union{Array{ST}, ST}) 
  where {PDType<:ParameterDistributionType, CType<:EnsembleKalmanProcesses.ParameterDistributions.ConstraintType, ST<:AbstractString} 
  at ~/.julia/packages/EnsembleKalmanProcesses/iWN0p/src/ParameterDistributions.jl:167
Stacktrace:
 [1] top-level scope
   @ ~/some_path/EnsembleKalmanProcesses.jl/examples/Lorenz/Lorenz_example.jl:98
in expression starting at /home/ben/some_path/Kalman_test/EnsembleKalmanProcesses.jl/examples/Lorenz/Lorenz_example.jl:85

I also tried the installation via the package manager, leading to the same error.
If you need any further information, please let me know.

On a side note, it also seems that the current version of Cloudy is incompatible with the EnsembleKalmanProcesses, as I wasn't able to install both into the same (empty) environment.

Kind regards,
Ben

@odunbar odunbar self-assigned this Apr 27, 2022
@odunbar
Copy link
Collaborator

odunbar commented Apr 27, 2022

Hi Ben,
Sorry the examples haven't worked out instantly! We have just updated EnsembleKalmanProcesses to a new interface, however we have not yet made these into a release yet. We will try to sort this out soon with a new breaking release.

This means, if you added EnsembleKalmanProcesses using something like

julia --project
]
add EnsembleKalmanProcesses

This will take the released version, not the latest one compatible with the examples.

Solution

One option, is to add EnsembleKalmanProcesses from the github address, or from a local path.
Go to Lorenz and remove the package:

julia --project
]
rm EnsembleKalmanProcesses

then (1) load it from the github main branch

add https://github.com/CliMA/EnsembleKalmanProcesses.jl#main

or (2) if you have a local version, add it locally

add ../..

my output using (1) gives:

2
[8.0; 2.5;;]
Using truth values to compute covariance
[0.22112428787318822 -0.004533149180349995 -0.0019610730500580365 0.03904494950054565; -0.004533149180349995 0.0637033768682159 -0.0009818730618963512 0.0023911706426016713; -0.0019610730500580365 -0.0009818730618963512 0.01675340867722733 -0.006785591840294391; 0.03904494950054565 0.0023911706426016713 -0.006785591840294391 0.05597049454872317]
EKP inversion error:
┌ Warning: New ensemble covariance determinant is less than 0.01 times its previous value.
│ Consider reducing the EK time step.
└ @ EnsembleKalmanProcesses ~/.julia/packages/EnsembleKalmanProcesses/U0thB/src/EnsembleKalmanInversion.jl:180
Iteration: 1, Error: 566.4761551590692
Iteration: 2, Error: 6.472141069453601
Iteration: 3, Error: 0.4077423818530319
Iteration: 4, Error: 0.39488169110060684
Iteration: 5, Error: 0.3243814378039824
True parameters: 
[8.0; 2.5;;]

EKI results:
[7.974555791388336; 2.4647490689605016;;]

(and some plots)

@benxro
Copy link
Author

benxro commented May 3, 2022

That works, great!
I followed your instructions (2) and received the same output as you.

Thank you very much @odunbar :)

@odunbar
Copy link
Collaborator

odunbar commented May 4, 2022

No problem!
Also PR #159 releases the new EKP version so hopefully adding from the registry will work as desired.

@odunbar odunbar closed this as completed May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants