Let . Since
integration from zero to gives . Letting and imposing unit total probability gives
The probability density function is positive for because . Consequently the cumulative distribution function is increasing, starts at zero and tends to one. This verifies that the derived normalizing constant defines a probability distribution. The family is the exponential-logarithmic distribution with the complementary mixing parameter .
Let and , evaluated from the given polylogarithm formulas. Generate a large sample of independent and identically distributed random variables with r_sample_f, and compute its sample mean and sample variance using mean and var. The central limit theorem gives the first standardized check:
For the second check, the correct asymptotic variance of the sample variance involves the fourth central moment :
The denominator is not unless the probability distribution has the requisite fourth central moment, as does the normal distribution. Here the probability density function decays exponentially, so all required moments are finite.
To compute , expand the denominator of the probability density function as a geometric series and integrate each nonnegative term. The gamma function integral gives the raw moments
Thus and . The following R code implements both checks for chosen interior parameters and large n:
p <- 0.4
beta <- 1.3
n <- 100000
raw_m <- vapply(1:4, function(j) {
  -factorial(j) * polylog(j + 1, 1 - p) / (beta^j * log(p))
}, numeric(1))
m <- raw_m[1]
v <- raw_m[2] - m^2
mu4 <- raw_m[4] - 4 * m * raw_m[3] +
  6 * m^2 * raw_m[2] - 3 * m^4
x <- r_sample_f(n, p, beta)
c(mean_check = sqrt(n) * (mean(x) - m) / sqrt(v),
  variance_check = sqrt(n) * (var(x) - v) / sqrt(mu4 - v^2))
For each check separately, an absolute value below is consistent with its approximate confidence interval. Repeat with many independent samples: the two standardized statistics should each resemble a standard normal distribution, with about outside that range. Also vary , and n; a systematic discrepancy that grows with suggests a bias. The two checks from the same sample are generally dependent, so passing both is not itself a joint statement, nor can a finite test prove that a generator is correct.
The second central limit theorem follows from the central limit theorem for the sample variance: differs by a quantity tending to zero in probability from .
Assume and a current state with , . The unnormalized posterior density is
Thus the log-posterior, up to an additive constant, is the log-likelihood plus the beta distribution and exponential distribution log prior densities. The exponential distribution rate is , since is its mean. [ref] [ref]
Choose a symmetric joint random-walk Metropolis algorithm proposal: and , for independent standard normal distribution draws. Its scale depends only on fixed hyperparameters, so forward and reverse proposal probability density functions agree. Reject immediately outside ; otherwise accept with Metropolis–Hastings acceptance probability
The following function makes exactly one proposal, with rejection retaining both old parameters:
MHstep <- function(x, p, beta, a, b, mu) {
  p_new <- rnorm(1, mean = p, sd = 0.1)
  beta_new <- rnorm(1, mean = beta, sd = mu / 2)
  if (p_new <= 0 || p_new >= 1 || beta_new <= 0)
    return(list(p = p, theta = beta))
  logpost <- function(pp, bb) {
    ll_f(pp, bb, x) + dbeta(pp, a, b, log = TRUE) +
      dexp(bb, rate = 1 / mu, log = TRUE)
  }
  logA <- logpost(p_new, beta_new) - logpost(p, beta)
  if (log(runif(1)) <= min(0, logA)) {
    p <- p_new
    beta <- beta_new
  }
  list(p = p, theta = beta)
}
The returned field theta contains the updated value of beta. The original PDF really asks for p and theta, although no parameter is defined in this question. This choice preserves its literal interface while making the intended second parameter explicit. A caller therefore advances with state <- MHstep(x, p, beta, a, b, mu), p <- state$p, and beta <- state$theta.
The proposal is an unrestricted symmetric normal distribution followed by rejection outside the support. Repeatedly drawing until a valid proposal appears would instead truncate and renormalize the proposal, requiring a proposal-density correction. The code uses immediate rejection and needs no such correction. The displayed scales are valid fixed choices; practical efficiency can be improved using a separate tuning phase.
Taking the logarithm of the normalized probability density function, then summing over the independent observations, gives the log-likelihood
Both and are parameters being inferred, so their contributions to the normalizing constant must be retained. The following R implementation validates the arguments and returns one number:
ll_f <- function(p, beta, x) {
  scalar <- function(v) {
    is.numeric(v) && !is.complex(v) && length(v) == 1L &&
      is.finite(v)
  }
  if (!scalar(p) || p <= 0 || p >= 1)
    stop("p must lie strictly between 0 and 1")
  if (!scalar(beta) || beta <= 0)
    stop("beta must be positive")
  if (!is.numeric(x) || is.complex(x) || !is.null(dim(x)) ||
      any(!is.finite(x)) || any(x <= 0))
    stop("x must be a vector of finite positive numbers")
  if (length(x) == 0L) return(0)
  t <- log1p(-p) - beta * x
  length(x) * (log(beta) - log(-log(p))) +
    sum(t - log(-expm1(t)))
}
Here and -expm1(t) computes accurately near zero. The empty-data likelihood function is one, so its log-likelihood is zero. Invalid parameter values produce errors in this evaluator; the next algorithm rejects candidates outside the parameter support before calling it.
Generate independent and identically distributed random variables with probability density function , evaluate for each draw, and return the Monte Carlo estimator
Linearity of expectation makes this an unbiased estimator: . Independence and the specified variance give . Its Monte Carlo standard error is therefore , and the strong law of large numbers gives convergence to almost surely.
Integrating the envelope shows . One trial of rejection sampling draws and an independent from the uniform distribution on , and accepts if . Repeat with fresh independent random variables after each rejection. Ratios need only be evaluated where ; the envelope makes the target zero wherever .
For any measurable set , integration of the conditional probability of acceptance gives
Taking the whole domain gives acceptance probability , and dividing gives . Fresh trials therefore supply independent and identically distributed random variables with target probability density function . The corresponding Monte Carlo estimator is
The proposal count up to and including one acceptance has the geometric distribution
For example, the tail-sum formula gives . Thus the expected cost is proposal draws per accepted target draw.
For a measurable set , (i) gives the joint acceptance probability
Divide by from (ii). The resulting conditional probability is
Thus every accepted value has target probability density function . Repeating rejected trials with fresh independent random variables does not change this law: the contribution from acceptance on trial is multiplied by , and summing that geometric series gives the same conditional law. Independent repetitions produce independent target draws.
Average the conditional probability in (i) over :
This is exactly the acceptance mass for an unnormalized rejection envelope. In normalized form the envelope is , giving the same acceptance probability. Here bounds the ratio of the unnormalized functions, so its value need not equal the envelope constant for the normalized probability density functions.
The squeeze changes the number of expensive target evaluations, while preserving the per-proposal acceptance probability. The expected number of proposals per accepted draw is .
The proposal's normalization of a probability distribution is
This is the Laplace distribution with location zero and scale one. For example, generate its magnitude from the exponential distribution with rate one and give it an independent fair sign. The target is the standard normal distribution, with .
To obtain the tight envelope, let . By completing the square,
Equality occurs at , so is the smallest valid envelope constant. It maximizes the acceptance probability for this fixed proposal. The supplied lower bound must be clipped at zero to satisfy the algorithm's nonnegativity requirement:
This is valid because for , while is everywhere positive. Its support is .
Here is the fully specified squeeze rejection sampling procedure. Draw with probability density function , independently draw , and compute and . If , return immediately. Otherwise evaluate , independently draw , and return if . On rejection restart with fresh draws. In this example everywhere, so the residual denominator is positive.
Avoiding a target evaluation means accepting at the first test. Its unconditional probability for one proposal is
For comparison, the overall acceptance probability is . The first-stage saving is the fraction of proposals requiring no target evaluation, including both eventual accepted and rejected proposals in the denominator; it is not conditional on acceptance.
For a random sample, write , , for its joint probability density functions. Let be any competing statistical test of level at most . Pointwise,
Indeed, where , ; where , , so both factors have the same sign. On the equality set the product is zero, regardless of randomization. Integrate over the joint sample space using its ordinary volume measure:
Since and ,
This proves maximal power. A continuous sample distribution does not itself guarantee that the equality set of the likelihood ratio has zero probability; allowing randomization there makes the proof valid in that case too.
For two simple statistical hypotheses with joint probability density functions and , fix a significance level . A randomized statistical test is the conditional probability of rejection given the data. Choose and, if necessary, randomization on the equality set so that
The Neyman-Pearson lemma says that this is a most powerful test among all tests with test size at most :
Thus the optimal ordering rejects where the alternative-to-null likelihood ratio is largest. On null-impossible observations with , the rejection probability is one. Randomization is dispensable whenever an ordinary threshold already attains the required test size.
Given observed data , a credible interval has posterior probability :
For a continuous posterior distribution with probability density function , this is . The probability is conditional on the observed data and concerns the statistical parameter under its posterior distribution; it does not assert frequentist coverage probability.
The given probability density function is that of a beta distribution with parameters and . We can derive the required moments directly rather than assuming the beta moment formulas. For an integer , the Euler beta function gives
Here for positive integers ; this identity also follows by repeated integration by parts. Taking yields
Subtract the square of the first moment from the second to obtain the variance:
These are exact finite-sample identities for each uniform order statistic.
The Neyman-Pearson lemma concerns a simple hypothesis against another simple hypothesis . For a continuous statistical sample, put for the joint probability density functions, . A randomized statistical test is a measurable , the conditional probability of rejection after observing . Its test size is and its statistical power is .
Choose and boundary randomization so that
Then is most powerful among all tests of size at most . Thus one rejects for sufficiently large alternative-to-null likelihood ratio. If the equality set has zero probability under , the test needs no randomization. Continuous observations alone do not guarantee that their likelihood ratio has a continuous probability distribution.
For the proof, let be any competing test with . At every ,
Indeed, on the first factor is ; on it is ; and on equality the product is zero. Integration gives
which proves the claimed optimality. Moreover, when , equality of statistical power forces equality of test size and forces almost everywhere where : otherwise the nonnegative integrand would have positive integral. This proves the usual necessity assertion as well, up to equality sets and sets of zero probability under both hypotheses.
For the beta distribution with parameters , the Euler beta function gives . Its probability density function is therefore on . Direct integration gives the raw moments
In particular, its mean is . Equating this to the sample mean and rearranging gives
The observations lie strictly between zero and one with probability one, so and this method of moments estimator is well defined and positive. This is an instance of estimation of a beta shape parameter.
An unknown variance requires a joint prior distribution for . The analysis is not determined until a prior for the unknown variance, and its relation to the coefficients, is specified. A maximum-likelihood estimate substituted for does not by itself account for its posterior uncertainty.
For example, retain the independent coefficient prior distributions from part (b) and independently assign an inverse-gamma distribution with shape and scale , whose probability density function is proportional to . Then the joint posterior density is proportional to
Conditional on , the two coefficient posterior distributions are still the independent normal distributions in part (b), with substituted for . The other full conditional distribution is
The marginal coefficient posterior distribution requires marginalization over ; it is generally nonnormal and the two coefficients need not remain independent. In particular, the posterior cumulative distribution function of the requested mean becomes
Its shortest 95% credible interval must be found from this marginal posterior distribution, for example by numerical integration or posterior simulation. This is normal regression with independent coefficient and variance priors.
A different, convenient choice is a normal-inverse-gamma prior, in which the conditional coefficient prior covariance matrix is proportional to . That choice gives a multivariate Student's t-distribution after marginalization, so the interval uses its univariate Student's t-distribution quantiles. It changes the coefficient prior specification; a Student interval does not follow automatically from retaining the fixed- priors in part (b).
The displayed identity requires a correction to the process construction in the source. In a piecewise-deterministic Markov process, the instantaneous hazard function is evaluated at the current flowing state , and the destination is sampled from . Keeping the jump times and destinations of the original Markov jump process instead evaluates both quantities at its last reset state , which generally differs from . The source PDF confirms that these original jump times and destinations were retained. Consequently its definition does not in general produce the asserted transition kernel, or even a Markov process in the state variable alone.
For an explicit counterexample, take , , , and let every be the standard normal distribution, independently of . These are smooth coefficients with bounded positive jump rate, so nonexplosion holds. In the literal construction, the first holding time has the exponential distribution of rate . Thus the probability distribution of has an atom of mass at . Paths with at least one jump contribute no atom there, because the reset has a normal density. The asserted identity instead assigns to this no-jump atom the mass
which differs for every .
Here is the full derivation for the intended piecewise-deterministic Markov process. Assume nonexplosion; smoothness alone does not guarantee it. Start at , let be the first jump after , and set
One precise construction draws an independent unit-rate exponential random variable and takes , with . This implements a hazard function along the flow of a vector field, rather than a fixed exponential holding time at the last reset. Its survival probability and jump-time probability density function are
Equivalently, with . On , the terminal state is . Conditional on , draw the new state from and restart the same construction from . The Markov property and the tower property of conditional expectation therefore give the first-jump decomposition of a piecewise-deterministic Markov process
This proves the requested identity under the corrected construction, for every bounded Borel measurable function . The two contributions partition according to whether the first jump occurs before ; later jumps are already contained in .
For comparison, the literal construction does have a different renewal identity when started at a reset with . If denotes only these reset-start operators, the same conditional expectation argument gives
These need not be the transition operators conditional on at an arbitrary time: that observation does not specify the hidden reset state. This distinction explains exactly why replacing only the between-jump paths is insufficient.
Use the corrected piecewise-deterministic Markov process from part (b). For a smooth test function , its time-dependent infinitesimal generator is
Indeed, over an interval of length , deterministic motion contributes , while a jump has probability and changes the conditional mean of by . Terms involving both drift and a jump contribute only to the remainder. Thus .
The Dynkin formula, or this infinitesimal expansion integrated against the current probability distribution, gives the weak evolution identity
Take , so integration by parts has no boundary contribution. Assuming the displayed jump integrals are finite, Fubini's theorem gives
Consequently the forward equation of a piecewise-deterministic Markov process is
Here is the formal adjoint operator acting on probability density functions. Its terms are transport, loss from , and incoming mass from every . In particular, the incoming rate is , evaluated at the departure state. The operator denoted in the source is generally time-dependent. Because , the gain and loss integrals cancel; with vanishing transport flux at infinity, .
The deterministic initial state in part (b) does not actually yield an everywhere smooth full density. For finite times the no-jump contribution is the positive measure
where is the Dirac measure at . Smooth jump destination probability density functions cannot remove this positive atom. The density equation above is therefore conditional on the extra density hypothesis, for example with a suitable random initial probability density function. For the specified fixed initial state, write for the whole probability measure and use instead
This weak measure evolution includes both the atom and any continuous component. It becomes the displayed partial differential equation whenever with the assumed regularity. It does not describe the literal hidden-reset construction without the correction in part (b).
Since , its supremum is nonnegative. For , continuity gives
The events increase with . Part (iii) therefore yields . Letting gives ; letting gives finiteness almost surely. Consequently
Its probability density function is , with no atom at zero. Using strict exceedances above also avoids presupposing that the infinite-horizon supremum is attained.
Conditioning on the observed time. The native PDF defines as the first production time and then conditions on that production occurring at . If the intended information is its numerical value , the answer depends on . We first compute this conditional probability using a conditional probability density; conditioning on an exact value of a continuous random variable means a density ratio, since .
Before , no molecules of the second chemical species are present, so the joint-removal chemical reaction cannot occur. Molecules of the first chemical species arrive as a rate- Poisson process, and each independently starts a clock with a rate- exponential distribution for producing the first molecule of the second chemical species. Define the unnormalized probability mass function
The chemical master equation before the first production, with production treated as killing, is
Multiplying by and summing gives a partial differential equation for the probability generating function:
Its solution, verifiable by direct differentiation, is
Thus , the survival function is , and the conditional distribution of given survival to is a Poisson distribution of mean .
Production in from Markov chain state has joint probability . Therefore the probability density function of is
The first production leaves unchanged. Taking the density ratio gives a size-biased distribution of the surviving count:
In particular, under this reading the requested conditional probability is
The shift by one matters: an observation made exactly when production occurs preferentially selects larger counts, since their production reaction propensity function is larger.
Without observing the numerical time. If the conditioning merely repeats the definition of , the requested probability is instead the unconditional count at that stopping time. Before production, increases by one at rate , while production occurs at rate in Markov chain state . The competing exponential clocks imply
The first factor requires a second arrival before production from count one; the second requires production before a third arrival. The first arrival itself is certain. Production eventually occurs with probability one, as is also clear from . As a consistency check, averaging the time-conditioned answer against gives
These are two distinct, explicitly specified interpretations of the printed conditioning.