Skip to content

curvefit.core.effects2params.unzip_x

Extract Fixed and Random Effects from Single Vector Form

Syntax

fe, re = curvefit.core.effects2params.unzip_x(x, num_groups, num_fe)

Arguments

  • x (np.array): a numpy vector with length equal to (num_groups + 1) * num_fe
  • num_groups (int): is the number of data groups
  • num_fe (int): is the number of fixed effects

Returns

  • fe (np.array): is a numpy vector containing the fist num_fe elements of x.
  • re (np.array): is a numpy two dimensional array with row dimension num_groups and column dimension num_fe. The i-th row of re contains the following sub-vector of x
        re[i,:] = x[(i+1)*num_fe : (i+2)*num_fe]

Example

unzip_x_xam