【问题标题】:Make this fig in R在R中制作这个无花果
【发布时间】:2023-03-10 09:39:01
【问题描述】:

我想在 R 中复制这个数字,而不是只是数据范围和函数信息的表。问题在于其中一些函数,它们都在 R 中完成。例如反双曲正弦,...?!谢谢

eq <- function(x) {arcsinh(x)}
tmp <- data.frame(x=1:50, y=eq(1:50))
p <- qplot(x, y, data=tmp, xlab="X-axis", ylab="Y-axis")
c <- stat_function(fun=eq)
print(p + c)

【问题讨论】:

  • curve(acosh,from=1.1,to=10, xlim=c(0,10))等?

标签: r function math graph figure


【解决方案1】:

基础 R 中没有 arcsinh 函数:

?sinh   # note that the function name is `asinh`

这成功了:

eq <- function(x) {asinh(x)}
tmp <- data.frame(x=1:50, y=eq(1:50))
p <- qplot(x, y, data=tmp, xlab="X-axis", ylab="Y-axis")
c <- stat_function(fun=eq)
print(p + c)

正如努力:

tmp <- data.frame(x=-50:50, y=eq(-50:50))

【讨论】:

  • 那为什么我提到你的页面(在它的最顶部)说:“他们分别计算双曲余弦,正弦,正切,以及它们的倒数,反余弦,反正弦,弧-正切(或“面积余弦”等)”?
  • 还要解释为什么 Wolfram 的 Eric Weinstein 认为它们是相同的:mathworld.wolfram.com/InverseHyperbolicSine.html
  • arcsinh 对 asinh 的转置有额外的旋转
【解决方案2】:

其中一些是基础的。

cosh(x)
sinh(x)
tanh(x)
acosh(x)
asinh(x)
atanh(x)

但这忽略了acsch(x)、asech(x) 和acoth(x)。您可以使用日志创建这些。

例如 acsch(x) 等价于 ln((1/x)+(sqrt(1+x^2)/abs(x))) ,即

plot(log(1/((-100:100)/100)+sqrt(1+(((-100:100)/100))^2)/abs((-100:100)/100)))

其他两个可以在这里找到http://en.wikipedia.org/wiki/Hyperbolic_function

【讨论】:

    猜你喜欢
    • 2017-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 2014-06-19
    相关资源
    最近更新 更多