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.
i don't understand the documentation here... what is this supposed to do?
There was a problem hiding this comment.
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.
Now I have rewritten my documentation again and hope that it is now more understandable.
There was a problem hiding this comment.
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.
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.
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.
Now I have added the explanations.
R/cf.R
Outdated
| #' FHT ratio | ||
| #' | ||
| #' @description | ||
| #' Computes Feynman-Hellmann theorem (FHT) ratio for given |
|
@NikSchlage this requires additional work! |
Add functions to