Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
juobs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier Ugarrio
juobs
Commits
2015cdb7
Commit
2015cdb7
authored
Jul 09, 2024
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fit_alg supports W and wpm now
parent
619245f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/juobs_tools.jl
src/juobs_tools.jl
+3
-2
No files found.
src/juobs_tools.jl
View file @
2015cdb7
...
...
@@ -1540,7 +1540,8 @@ function fit_alg(f::Function, x::Union{Vector{Int64}, Vector{Float64}, Matrix{Fl
end
function
fit_alg
(
model
::
Function
,
x
::
Array
{
Float64
},
y
::
Array
{
uwreal
},
param
::
Int64
,
W
::
Matrix
{
Float64
};
guess::Union{Float64, Vector{Float64}, Nothing}=nothing)
guess
::
Union
{
Float64
,
Vector
{
Float64
},
Nothing
}
=
nothing
,
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
if
guess
==
nothing
p00
=
[
.
5
for
i
in
1
:
param
]
...
...
@@ -1552,7 +1553,7 @@ function fit_alg(model::Function,x::Array{Float64},y::Array{uwreal},param::Int64
chisq_corr
(
par
,
dat
)
=
juobs
.
gen_chisq_correlated
(
model
,
x
,
W
,
par
,
dat
)
fit
=
curve_fit
(
model
,
x
,
value
.
(
y
),
W
,
p00
)
up, chi_exp = fit_error(chisq_corr, coef(fit), y, W=W)
up
,
chi_exp
=
fit_error
(
chisq_corr
,
coef
(
fit
),
y
,
wpm
,
W
=
W
)
uwerr
.
(
up
)
chi2
=
sum
(
fit
.
resid
.^
2
)
pval
=
pvalue
(
chisq_corr
,
sum
(
fit
.
resid
.^
2
),
value
.
(
up
),
y
,
W
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment