pca eig

High-Volume Sensor Analysis with Weighting and Covariance

Scénario de test & Cas d'usage

Business Context

A manufacturing plant monitors heavy machinery using dozens of sensors. They need to analyze the raw variance (Covariance) rather than correlation, because the magnitude of vibration signals matters. Some sensors are more critical than others, so a weighted analysis is required. The dataset is large, simulating high-frequency logs.
Data Preparation

Simulating high-volume sensor data with varying magnitudes and a weight variable.

Copied!
1 
2DATA casuser.sensors;
3call streaminit(456);
4array s[10] s1-s10;
5DO i = 1 to 50000;
6DO j = 1 to 10;
7IF j <= 5 THEN s[j] = rand('Normal', 10, 1);
8ELSE s[j] = rand('Normal', 1000, 50);
9END;
10machine_weight = rand('Uniform');
11OUTPUT;
12END;
13 
14RUN;
15 

Étapes de réalisation

1
Run weighted PCA using the Covariance matrix on a large dataset, enabling GPU acceleration if available.
Copied!
1 
2PROC CAS;
3pca.eig / TABLE={name='sensors', caslib='casuser'} inputs={'s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10'} cov=true weight='machine_weight' gpu={enable=true} OUTPUT={casOut={name='sensor_scores', caslib='casuser', replace=true}, score='Component'};
4 
5RUN;
6 

Expected Result


The action uses the raw variance (Covariance) where 's6-s10' (larger magnitude) will likely dominate the first component. The analysis considers 'machine_weight'. If GPU is available, processing is accelerated.