Classes

Simrel Class

class pysimrel.Simrel(n_pred: Union[str, int] = 10, n_relpred: Union[str, int] = '4, 5', pos_relcomp: Union[str, int] = '0, 1; 2, 3, 4', gamma: float = 0.7, rsq: Union[str, int] = '0.7, 0.8', n_resp: Union[str, int] = 4, eta: float = 0.7, pos_resp: Union[str, int] = '0, 2; 1, 3', mu_x: Union[str, int] = None, mu_y: Union[str, int] = None, parameter_parsed: bool = False, properties_computed: bool = False)[source]

Main Class for simulated objects

The class contains all the definitions of simrel objects. The class will also provide necessary methods to compute various population properties.

n_pred

Number of predictor variables. Ex: n_pred: 10

Type:Either integer or string
n_relpred

Number of relevant predictor variables for each response components In the case of single response model, the parameters refers to the number of predictors relevant for that single response

Type:Either integer or string
parse_parameters()[source]

Parse the parameters passed during initialization This method parse the parameters which are passed as string into a nested list. It uses parse_parm() function where further documentation can be found.

Helper Classes

class pysimrel.Covariances[source]

Class defining various covariances of the simulated data

This provides a nice graphical output of covariances.

Parameters:
  • cov_ww (np.ndarray) – Covariance matrix of latent components of response
  • cov_zz (np.ndarray) – Covariance matrix of latent components of predictors
  • cov_zw (np.ndarray) – Covariance matrix containing covariances between latent components of predictors and response
  • cov_yy (np.ndarray) – Covariance matrix of response
  • cov_xx (np.ndarray) – Covariance matrix of response
  • cov_xy (np.ndarray) – Covariance matrix containing covariances between predictors and response
class pysimrel.Properties[source]

A data class for different properties of simulated object

Parameters:
  • eigen_x (np.ndarray) – Eigenvalues corresponding to predictors
  • eigen_y (np.ndarray) – Eigenvalues corresponding to responses
  • relevant_predictors (np.ndarray) – Position index of relevant predictors for each responses
  • sigma_latent (np.ndarray) – Variance-Covariance matrix of latent components of predictors and Responses
  • sigma (np.ndarray) – Variance-Covariance matrix of predictors and Responses
  • beta_z (np.ndarray) – Regression coefficient corresponding to the principal components of predictors
  • beta (np.ndarray) – Regression coefficient corresponding to the predictor variables
  • beta0 (np.ndarray) – Regression Intercept
  • rsq_w (np.ndarray) – Coefficient of determination for latent component of responses (Variation explained by latent components of predictors on latent components of response)
  • rsq (np.ndarray) – Coefficient of determination for responses (Variation explained by predictors on response)
  • minerror (np.ndarray) – True minimum model error
  • rotation_x (np.ndarray) – Rotation Matrix (eigenvector matrix) corresponding to predictors
  • rotation_y (np.ndarray = None) – Rotation Matrix (eigenvector matrix) corresponding to response
class pysimrel.Data(X: numpy.ndarray, Y: numpy.ndarray)[source]