Classes¶
Simrel Class¶
- class 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: Optional[Union[str, int]] = None, mu_y: Optional[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.
>>> sobj = Simrel(n_pred = 10, n_relpred = '4, 5', pos_relcomp = '0, 1; 2, 3, 4', gamma = 0.7, rsq = '0.7, 0.8', n_resp = 4, eta = 0.7, pos_resp = '0, 2; 1, 3')
>>> print(sobj.properties) Numpy Arrays: --------------------------------------------- eigen_x: Shape: (10,) eigen_y: Shape: (4,) rotation_x: Shape: (10, 10) rotation_y: Shape: (4, 4) sigma_latent: Shape: (14, 14) sigma: Shape: (14, 14) rsq: Shape: (4, 4) rsq_w: Shape: (4, 4) minerror: Shape: (4, 4) beta_z: Shape: (10, 4) beta: Shape: (10, 4) beta0: Shape: (4,) Dictionaries: --------------------------------------------- relevant_predictors: Keys: rel, irrel
>>> print(sobj.covariances) Numpy Arrays: +-------------+-------------------+ | | | | cov_ww | cov_wz | | cov_yy | cov_xy | | (4, 4) | (4, 10) | | | | +-------------+-------------------+ | | | | | | | cov_zw | cov_zz | | cov_xy | cov_xx | | (10, 4) | (10, 10) | | | | | | | +-------------+-------------------+
- 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
Helper Classes¶
- class 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 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