Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model response vector and experiment vector shape do not match with multiple sensors #96

Open
shangwjen opened this issue Mar 20, 2023 · 1 comment

Comments

@shangwjen
Copy link

For probeye 3.0.4, in the situation of multiple output sensors with a single correlation results in a shape mismatch error:
image
This occurs due to the list concatenation of the values from the multiple output sensors.

Is this intended? And if yes, what would be a solution to make this situation work?

To reproduce the error edit test_1D_correlation_multiplicative_model_error from line 171 to 187 with:

for i in range(n_experiments):
    y_test = np.random.multivariate_normal(mean=y_true, cov=cov)
    problem.add_experiment(
        name=f"Test_{i}",
        sensor_data={
            "x": x_test,
            "y": y_test,
            "y1": y_test+1,
        },
    )
    if plot:
        plt.scatter(
            x_test,
            y_test,
            label=f"measured data (test {i + 1})",
            s=10,
            zorder=10,
        )

where "y1": y_test + 1 is added.

and for line 205 replace with:

self.output_sensors = [Sensor("y", std_model="sigma"), Sensor("y1", std_model="sigma")]

where Sensor("y1", std_model="sigma") was added to the line.

@joergfunger
Copy link
Member

joergfunger commented Mar 20, 2023

What exactly do you expect? If the two sensors are supposed to be uncorrelated then this is somehow similar to this. In case they are correlated, how would you like to define the covariance matrix, something like ( [sigma_y1, sigma_y2]^T cor[cor_x, cor_x; cor_x,cor_x] [sigma_y1, sigma_y2]), where cor_x is the correlation between a single set of measurements based on x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants