# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Test a one-sided truncation with a lower tail.
parameters = 12.0, 2.4, -Infinity, 7.1
mean = 6.21558810518581
variance = 0.644197315721623
lower = -Infinity
upper = 7.1
# Computed using Python with SciPy v1.6.0.
# mean, std, clip_a, clip_b = 12.0, 2.4, -float('inf'), 7.1
# a, b = (clip_a - mean) / std, (clip_b - mean) / std
# truncnorm.var(a, b, loc=mean, scale=std)
cdf.points = \
  -Infinity, 2.20249292901062, 3.00511196424565, 3.80773099948069,\
  4.61035003471573, 5.41296906995077, 6.21558810518581, 7.01820714042084, 7.1
cdf.values = \
  0.                  , 0.001082764149718835, 0.004330322477085105,\
  0.015575480942199732, 0.050427133162224455, 0.14710687901638747 ,\
  0.38715964332177927 , 0.920668099879135   , 1.
pdf.values = \
  0.                   , 0.0019418113731956834,\
  0.007191653115383996 , 0.0238165586714951   ,\
  0.07052739999811058  , 0.18675202746331704  ,\
  0.44218230973931666  , 0.9361942928302114   ,\
  1.0042381761830197

# Overridden tolerances
logpdf.relative = 2e-13
moments.relative = 1e-13
