A computer-implemented method for data analysis comprising: receiving a new observation to be input to a deep neural network for processing data, the deep neural network having a plurality of hidden layers and trained using a training data set that includes possible observations that can be input to the deep neural network; obtaining a second set of intermediate output values that are output from at least one of the plurality of hidden layers by inputting the received new observation to the deep neural network; mapping, using a latent variable model stored in a storage medium, the second set of intermediate output values to a second set of projected values, the second set of intermediate output values being the set of observable variables for the latent variable model and the second set of projected values being the set of the latent variables for the latent variable model; determining whether or not the received new observation is an outlier with respect to the training dataset based on the latent variable model and the second set of projected values, and controlling a device using the predictions and the results of outlier determination; wherein the latent variable model stored in the storage medium is constructed by: obtaining first sets of intermediate output values that are output from said one of the plurality of hidden layers, each of the first sets of intermediate output values obtained by inputting a different one of the possible observations included in said at least the part of the training dataset; and constructing the latent variable model using the first sets of intermediate output values, the latent variable model providing a mapping of the first sets of intermediate output values to first sets of projected values in a sub-space that has a dimension lower than a dimension of the sets of the intermediate outputs, the first sets of intermediate output values being the sets of observable variables for the latent variable model and the first sets of projected values being the sets of the latent variables for the latent variable model, and wherein the received new observation and each observation included in the training dataset contain sensor data obtained by one or more sensors at a point of time or during a period of time. receiving a new observation to be input to a deep neural network for processing data, the deep neural network having a plurality of hidden layers and trained using a training data set that includes possible observations that can be input to the deep neural network; obtaining a second set of intermediate output values that are output from at least one of the plurality of hidden layers by inputting the received new observation to the deep neural network; mapping, using a latent variable model stored in a storage medium, the second set of intermediate output values to a second set of projected values, the second set of intermediate output values being the set of observable variables for the latent variable model and the second set of projected values being the set of the latent variables for the latent variable model; determining whether or not the received new observation is an outlier with respect to the training dataset based on the latent variable model and the second set of projected values, and controlling a device using the predictions and the results of outlier determination; wherein the latent variable model stored in the storage medium is constructed by: obtaining first sets of intermediate output values that are output from said one of the plurality of hidden layers, each of the first sets of intermediate output values obtained by inputting a different one of the possible observations included in said at least the part of the training dataset; and constructing the latent variable model using the first sets of intermediate output values, the latent variable model providing a mapping of the first sets of intermediate output values to first sets of projected values in a sub-space that has a dimension lower than a dimension of the sets of the intermediate outputs, the first sets of intermediate output values being the sets of observable variables for the latent variable model and the first sets of projected values being the sets of the latent variables for the latent variable model, and obtaining first sets of intermediate output values that are output from said one of the plurality of hidden layers, each of the first sets of intermediate output values obtained by inputting a different one of the possible observations included in said at least the part of the training dataset; and constructing the latent variable model using the first sets of intermediate output values, the latent variable model providing a mapping of the first sets of intermediate output values to first sets of projected values in a sub-space that has a dimension lower than a dimension of the sets of the intermediate outputs, the first sets of intermediate output values being the sets of observable variables for the latent variable model and the first sets of projected values being the sets of the latent variables for the latent variable model, and wherein the received new observation and each observation included in the training dataset contain sensor data obtained by one or more sensors at a point of time or during a period of time.