getRoot: Solve $psi'(alpha_0) = c$

Description Usage Arguments Details Value

View source: R/getRoot.R

Description

A Newton iteration approach to solve $psi'(alpha_0) = c$, where $psi(x)$ and $psi'(x)$ denote the digamma and trigamma functions, respectively.

Usage

1
getRoot(c, eps = 1e-8)

Arguments

c

The scalar constant $c$ in the target equation $psi'(alpha_0) = c$

eps

tolerance

Details

We apply the Newton iteration approach to solve $psi'(alpha_0) = c$. In the initial iteration, we set $alpha^(0)_0=0.5+1/a$. In the $k$th iteration, we let $alpha^(k+1)=alpha^(k)+psi'(alpha^(k))1 - psi'(alpha^(k))/a}/ psi”(alpha^(k))$. The Newton iteration stops until $|alpha^(k+1)-alpha^(k)|/alpha^(k) < epsilon$, where $epsilon$ is a small positive number.

Value

y

Solution to the target euqtion


cuiyingbeicheng/Foldseq documentation built on May 18, 2020, 6:31 a.m.