Identifying models from data with errors in both outputs and inputs is a challenging task. In this work, we address this task by proposing a novel algorithm DIPCA that can identify models from data with errors in both outputs and inputs. The algorithm can also estimate the system order.