Returns the number of knots, knot locations, and weights.
meridian
.
model
.
knots
.
get_knot_info
(
n_times
:
int
,
knots
:
(
int
|
Collection
[
int
]
|
None
),
enable_aks
:
bool
=
False
,
data
:
(
meridian
.
data
.
input_data
.
InputData
|
None
)
=
None
,
is_national
:
bool
=
False
)
->
meridian
.
model
.
knots
.
KnotInfo
Args
An optional integer or a collection of integers indicating the knots
used to estimate time effects. When
knots
is a collection of integers,
the knot locations are provided by that collection. Zero corresponds to a
knot at the first time period, one corresponds to a knot at the second
time, ..., and (n_times - 1)
corresponds to a knot at the last time
period. When knots
is an integer, then there are knots with locations
equally spaced across the time periods (including knots at zero and (n_times - 1)
. When knots
is 1
, there is a single common regression
coefficient used for all time periods. If knots
is None
, then the
numbers of knots used is equal to the number of time periods. This is
equivalent to each time period having its own regression coefficient.A boolean indicating whether to use the Automatic Knot Selection
algorithm to select optimal number of knots for running the model instead
of the default 1 for national and n_times for non-national models.
An Optional InputData object used by the Automatic Knot Selection
algorithm to calculate optimal number of knots from the provided Input
Data.
Returns
A KnotInfo that contains the number of knots, the location of knots, and the
weights used to multiply with the knot values to get time-varying
coefficients.



