PTMLocScale.from_nparam()#
- classmethod PTMLocScale.from_nparam(y, nparam, knots_lo=-3.0, knots_hi=3.0, transition_width=0.3, normalization_tau2=None, scale_after_transformation=False, scaling_factor=None, shape_param_prior=ShapePrior.RANDOM_WALK)[source]#
Initializes a penalized transformation model automatically from the desired number of shape parameters.
- Parameters:
y (
Any
) – The observed response variable.nparam (
int
) – The number of parameters in the spline segment of the transformation function. Called \(J\) in the paper.knots_lo (
float
) – Lower and upper boundary knot, used to define an equidistant knot grid for the transformation function. (default:-3.0
)knots_hi (
float
) – Lower and upper boundary knot, used to define an equidistant knot grid for the transformation function. (default:3.0
)transition_width (
float
) – The width of the transition segment of the transformation function. A number larger than 0, indicating the length in terms of a multiple of the range of interior knots. Called \(\lambda\). (default:0.3
)scale_after_transformation (
bool
) – Whether to scale the transformed residuals. (default:False
)scaling_factor (
Optional
[Var
]) – The scaling factor \(\omega\) for the transformation function. IfNone
, the scaling factor will be fixed to one. (default:None
)shape_param_prior (
ShapePrior
) – The prior distribution for the shape parameter. (default:<ShapePrior.RANDOM_WALK: 1>
)
- Return type: