@@ -195,6 +195,8 @@ def __init__(
195195 scale_link : LinkFunction = Log (),
196196 skew_link : LinkFunction = Log (),
197197 shape_link : LinkFunction = LogShiftTwo (),
198+ start_value_mixing : float = 0.5 ,
199+ use_gamlss_init_values : bool = False ,
198200 ) -> None :
199201 super ().__init__ (
200202 links = {
@@ -204,6 +206,8 @@ def __init__(
204206 3 : shape_link ,
205207 }
206208 )
209+ self .gamlss_init_values = use_gamlss_init_values
210+ self .start_value_mixing = start_value_mixing
207211 self ._st3dist = SkewT ()
208212
209213 def _map (self , theta ):
@@ -215,6 +219,9 @@ def _map(self, theta):
215219 sigma_0 = sigma / np .sqrt (s2 )
216220 return mu_0 , sigma_0 , nu , tau , c
217221
222+ def mean (self , theta : np .ndarray ) -> np .ndarray :
223+ return theta [:, 0 ]
224+
218225 def cdf (self , y : np .ndarray , theta : np .ndarray ) -> np .ndarray :
219226 _ , _ , nu , tau = self .theta_to_params (theta )
220227 mu_0 , sigma_0 , nu , tau , c = self ._map (theta )
@@ -281,9 +288,14 @@ def initial_values(self, y: np.ndarray) -> np.ndarray:
281288 dynamic_values = np .zeros_like (constant_values )
282289 dynamic_values [:, 0 ] = y # mu
283290 dynamic_values [:, 1 ] = np .abs (y - np .mean (y )) # sigma
284- dynamic_values [:, 2 ] = np .abs (y - np .median (y )) / constant_values [:, 1 ] # tau
285- dynamic_values [:, 3 ] = np .abs (y - np .mean (y )) / constant_values [:, 1 ] # nu
286- return dynamic_values
291+ dynamic_values [:, 2 ] = 1 + np .sign (y - np .mean (y )) * np .abs (
292+ (y - np .mean (y )) / (np .std (y , ddof = 1 ) ** 3 )
293+ ) # nu
294+ dynamic_values [:, 3 ] = (
295+ 2.5 + np .abs (y - np .mean (y )) / constant_values [:, 1 ]
296+ ) # tau
297+ mixed_values = self ._svm * constant_values + (1 - self ._svm ) * dynamic_values
298+ return mixed_values
287299
288300 def dl1_dp1 (self , y , theta , param ):
289301 self ._validate_dln_dpn_inputs (y , theta , param )
0 commit comments