-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cf adds #309
base: master
Are you sure you want to change the base?
Cf adds #309
Conversation
#' treated as seperate and indepenent, such that the real part of cf is | ||
#' divided by itself and multiplied with n and similarly for the imaginary part. | ||
#' | ||
#' Note that this is generally only allowed on bootstrap samples and mean values, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand the documentation here... what is this supposed to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the FHT ratio function fht_ratio.cf() I calculate the prefactor z/sqrt(z^2 - 1), i.e. "pre <- z / pow.cf(z * z - num.cf(z), n=0.5)". In this, z is a cf object and consequently z * z is also a cf object, because the objects are multiplied element by element. This means that you cannot simply subtract a numeric value. Therefore, I wrote the function num.cf(), which assigns a numeric value to each entry of the passed cf object, in this case 1, since "num.cf <- function(cf, n=1.)". The result is a cf object with the same dimension as z * z that can be subtracted. So here the value 1 is always subtracted. I achieve the assignment of a numeric value n to all entries via cf$cf <- n * (cf$cf/cf$cf) or cf$icf <- n * (cf$icf/cf$icf). This is what I meant with "the real part of cf is divided by itself and multiplied with n and similarly for the imaginary part.".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I have rewritten my documentation again and hope that it is now more understandable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove the check "if( has_icf(cf) )" also in the functions num.cf()? Just like in pow.cf() don't see that it is needed.
pow.cf <- function(cf, n=1.) { | ||
stopifnot(inherits(cf, 'cf_meta')) | ||
if(inherits(cf, 'cf_orig')) { | ||
cf$cf <- (cf$cf)^n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you actually want to take a power of the original data or is this an operation which should only be carried out on the mean value and bootstrap samples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to take a power of the original data to keep the function as general as possible. However, in my analysis I passed bootstrapped correlation functions to this function.
R/cf.R
Outdated
#' | ||
#' @param cf2pt `cf_orig` object. | ||
#' @param cf3pt `cf_orig` object. | ||
#' @param tau Numeric. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain what this is please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I have added the explanations.
R/cf.R
Outdated
#' FHT ratio | ||
#' | ||
#' @description | ||
#' Computes Feynman-Hellmann theorem (FHT) ratio for given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a formula might help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is done.
@NikSchlage this requires additional work! |
Add functions to