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
66634ada
Commit
66634ada
authored
1 year ago
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug in pvalue
parent
bdfb1f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
src/juobs_tools.jl
src/juobs_tools.jl
+4
-8
No files found.
src/juobs_tools.jl
View file @
66634ada
...
@@ -1589,12 +1589,11 @@ Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000)
...
@@ -1589,12 +1589,11 @@ Q = pvalue(chisq, chi2, value.(up), y, wpm; W = 1.0 ./ err.(y) .^ 2, nmc=10000)
```
```
"""
"""
function
juobs
.
pvalue
(
chisq
::
Function
,
function
pvalue
(
chisq
::
Function
,
chi2
::
Float64
,
chi2
::
Float64
,
xp
::
Vector
{
Float64
},
xp
::
Vector
{
Float64
},
data
::
Vector
{
uwreal
};
data
::
Vector
{
uwreal
};
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
Dict
{
Int64
,
Vector
{
Float64
}}(),
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
Dict
{
Int64
,
Vector
{
Float64
}}(),
W
::
Vector
{
Float64
}
=
Vector
{
Float64
}(),
nmc
::
Int64
=
5000
)
nmc
::
Int64
=
5000
)
n
=
length
(
xp
)
# Number of fit parameters
n
=
length
(
xp
)
# Number of fit parameters
...
@@ -1618,8 +1617,7 @@ function juobs.pvalue(chisq::Function,
...
@@ -1618,8 +1617,7 @@ function juobs.pvalue(chisq::Function,
ForwardDiff
.
hessian!
(
hess
,
ccsq
,
xav
,
cfg
)
ForwardDiff
.
hessian!
(
hess
,
ccsq
,
xav
,
cfg
)
if
(
m
-
n
>
0
)
if
(
m
-
n
>
0
)
if
(
length
(
W
)
==
0
)
W
=
zeros
(
Float64
,
m
)
Ww
=
zeros
(
Float64
,
m
)
for
i
in
1
:
m
for
i
in
1
:
m
if
(
data
[
i
]
.
err
==
0.0
)
if
(
data
[
i
]
.
err
==
0.0
)
#isnothing(wpm) ? wuerr(data[i]) : uwerr(data[i], wpm)
#isnothing(wpm) ? wuerr(data[i]) : uwerr(data[i], wpm)
...
@@ -1628,10 +1626,8 @@ function juobs.pvalue(chisq::Function,
...
@@ -1628,10 +1626,8 @@ function juobs.pvalue(chisq::Function,
error
(
"Zero error in fit data"
)
error
(
"Zero error in fit data"
)
end
end
end
end
W
w
[
i
]
=
1.0
/
data
[
i
]
.
err
^
2
W
[
i
]
=
1.0
/
data
[
i
]
.
err
^
2
end
end
W
=
Ww
end
m
=
length
(
data
)
m
=
length
(
data
)
n
=
size
(
hess
,
1
)
-
m
n
=
size
(
hess
,
1
)
-
m
...
@@ -1671,7 +1667,7 @@ function juobs.pvalue(chisq::Function,
...
@@ -1671,7 +1667,7 @@ function juobs.pvalue(chisq::Function,
return
Q
return
Q
end
end
function
juobs
.
pvalue
(
chisq
::
Function
,
function
pvalue
(
chisq
::
Function
,
chi2
::
Float64
,
chi2
::
Float64
,
xp
::
Vector
{
Float64
},
xp
::
Vector
{
Float64
},
data
::
Vector
{
uwreal
};
data
::
Vector
{
uwreal
};
...
...
This diff is collapsed.
Click to expand it.
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