我需要 R 代码的帮助来估计反双曲正弦变换的 theta。此转换对于转换包含负值或零的倾斜数据很有用。
有一些相关的帖子讨论了 IHS,并建议有一种最大可能性的方法来估计 theta,但我不知道如何应用它。这些相关的帖子是:
请参阅下面的示例代码。我通过使用 IHS 的倒数制作了倾斜的数据。现在,考虑到偏斜的数据,并且没有关于 theta 的先验知识,我该如何计算出 theta 应该是什么?我将非常感谢 R 代码进行此分析。
# Define the IHS transformation and its inverse
IHS <- function(x, theta){ # Inverse IHS transformation
(1/theta)*asinh(theta * x)
}
Inv.IHS <- function(x, theta){ # IHS transformation
(1/theta)*sinh(theta * x)
}
set.seed(1)
# generate some normal data
x <- rnorm(1000)
hist(x, breaks='FD')
# skew it by applying the Inverse of the IHS transformation
xt <- Inv.IHS(x, theta=2)
hist(xt, breaks='FD') # yep this is skewed. How could we estimate theta?