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
560937f1
Commit
560937f1
authored
Oct 06, 2022
by
Alejandro Saez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md_val for TSM
parent
7a934361
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
src/juobs_tools.jl
src/juobs_tools.jl
+25
-21
No files found.
src/juobs_tools.jl
View file @
560937f1
...
...
@@ -432,7 +432,7 @@ m_md1, m_md2 = md_val(m, corr_pp[1], derm[1])
m_shifted = m + dm1 * m_md1 + dm2 * m_md2
```
"""
function
md_val
(
a
::
uwreal
,
obs
::
Corr
,
derm
::
Vector
{
Corr
};
new_version
::
Bool
=
false
)
function
md_val
(
a
::
uwreal
,
obs
::
Corr
,
derm
::
Vector
{
Corr
};
new_version
::
Bool
=
false
,
TSM
::
Bool
=
false
)
nid
=
neid
(
a
)
if
nid
!=
1
error
(
"Error: neid > 1"
)
...
...
@@ -471,27 +471,31 @@ function md_val(a::uwreal, obs::Corr, derm::Vector{Corr}; new_version::Bool=fals
=#
der
=
length
(
a
.
der
)
>=
maximum
(
n_ow
)
?
a
.
der
[
n_ow
]
*
w_mean
:
0.0
elseif
all
(
count
.
(
prop
)
.==
3
)
corr_der
=
getfield
.
(
corr
,
:
der
)
n
=
findall
.
(
t
->
t
==
1
,
prop
)
n
=
vcat
(
n
'
...
)
if
all
(
n
[
:
,
1
]
.==
n
[
1
,
1
])
# find ow and w
n_w
=
n
[
1
,
1
]
n_ow1
=
n
[
:
,
2
]
n_ow2
=
n
[
:
,
3
]
elseif
all
(
n
[
:
,
2
]
.==
n
[
1
,
2
])
n_w
=
n
[
1
,
2
]
n_ow1
=
n
[
:
,
1
]
n_ow2
=
n
[
:
,
3
]
elseif
all
(
n
[
:
,
3
]
.==
n
[
1
,
3
])
n_w
=
n
[
1
,
3
]
n_ow1
=
n
[
:
,
1
]
n_ow2
=
n
[
:
,
2
]
end
w_mean
=
1
/
getindex
.
(
corr_der
,
n_ow1
)[
1
]
if
1
/
getindex
.
(
corr_der
,
n_ow1
)[
1
]
!=
1
/
getindex
.
(
corr_der
,
n_ow2
)[
1
]
error
(
"w_mean with n_ow1 and with n_ow2 different"
)
if
TSM
==
false
return
nothing
else
corr_der
=
getfield
.
(
corr
,
:
der
)
n
=
findall
.
(
t
->
t
==
1
,
prop
)
n
=
vcat
(
n
'
...
)
if
all
(
n
[
:
,
1
]
.==
n
[
1
,
1
])
# find ow and w
n_w
=
n
[
1
,
1
]
n_ow1
=
n
[
:
,
2
]
n_ow2
=
n
[
:
,
3
]
elseif
all
(
n
[
:
,
2
]
.==
n
[
1
,
2
])
n_w
=
n
[
1
,
2
]
n_ow1
=
n
[
:
,
1
]
n_ow2
=
n
[
:
,
3
]
elseif
all
(
n
[
:
,
3
]
.==
n
[
1
,
3
])
n_w
=
n
[
1
,
3
]
n_ow1
=
n
[
:
,
1
]
n_ow2
=
n
[
:
,
2
]
end
w_mean
=
1
/
getindex
.
(
corr_der
,
n_ow1
)[
1
]
if
1
/
getindex
.
(
corr_der
,
n_ow1
)[
1
]
!=
1
/
getindex
.
(
corr_der
,
n_ow2
)[
1
]
error
(
"w_mean with n_ow1 and with n_ow2 different"
)
end
der
=
length
(
a
.
der
)
>=
maximum
(
n_ow1
)
&&
length
(
a
.
der
)
>=
maximum
(
n_ow2
)
?
a
.
der
[
n_ow1
]
*
w_mean
:
0.0
end
der
=
length
(
a
.
der
)
>=
maximum
(
n_ow1
)
&&
length
(
a
.
der
)
>=
maximum
(
n_ow2
)
?
a
.
der
[
n_ow1
]
*
w_mean
:
0.0
else
return
nothing
end
...
...
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