https://github.com/hugomvale/odrpack.jl
Julia bindings for the modernized version of odrpack95.
https://github.com/hugomvale/odrpack.jl
mathematics regression statistics
Last synced: 4 months ago
JSON representation
Julia bindings for the modernized version of odrpack95.
- Host: GitHub
- URL: https://github.com/hugomvale/odrpack.jl
- Owner: HugoMVale
- License: mit
- Created: 2025-07-06T17:14:29.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-09-06T13:59:27.000Z (10 months ago)
- Last Synced: 2025-10-21T11:52:59.922Z (8 months ago)
- Topics: mathematics, regression, statistics
- Language: Julia
- Homepage: https://hugomvale.github.io/Odrpack.jl/
- Size: 745 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Odrpack.jl
[](https://github.com/HugoMVale/Odrpack.jl/actions)
[](https://coveralls.io/github/HugoMVale/Odrpack.jl?branch=main)
[](https://deepwiki.com/HugoMVale/Odrpack.jl)
## Description
This Julia package provides bindings for the well-known weighted orthogonal distance regression (ODR) solver [odrpack95].
Orthogonal distance regression, also known as [errors-in-variables regression], is designed primarily for instances when both
the explanatory and response variables have significant errors.
[errors-in-variables regression]: https://en.wikipedia.org/wiki/Errors-in-variables_models
[odrpack95]: https://github.com/HugoMVale/odrpack95
## Installation
You can install the package in the usual way:
```julia
using Pkg
Pkg.add("Odrpack")
```
## Documentation and Usage
The following example demonstrates a simple use of the package. For more comprehensive examples and explanations, please refer to the [documentation](https://hugomvale.github.io/Odrpack.jl/) pages.
```julia
using Odrpack
function f!(x::Vector{Float64}, beta::Vector{Float64}, y::Vector{Float64})
y .= beta[1] .* exp.(beta[2] .* x)
return nothing
end
xdata = [0.982, 1.998, 4.978, 6.01]
ydata = [2.7, 7.4, 148.0, 403.0]
beta0 = [2.0, 0.5]
bounds = ([0.0, 0.0], [10.0, 0.9])
sol = odr_fit(
f!,
xdata,
ydata,
beta0,
bounds=bounds,
# rptfile="test_output.txt",
# report=:long
)
println("Optimized β :", sol.beta)
println("Optimized δ :", sol.delta)
println("Optimized x + δ:", sol.xplusd)
```
```sh
Optimized β :[1.633376, 0.9]
Optimized δ :[-0.368861, -0.312730, 0.029286, 0.110314]
Optimized x + δ:[0.613138, 1.685269, 5.007286, 6.120314]
```