(self, weights)
return pmean, pvar ** (1 / 2)
Compute mean and standard deviation of some allocation.

        Parameters
        ----------
        weights : np.array
            1D array representing weights of a portfolio. Has shape `(n_assets,)`.

        Returns
        -------
        mean : float
            Mean (return)
        std : float
            Standard deviation (risk)
Compute mean and standard deviation of some allocation.
Compute mean and standard deviation of some allocation .
def compute_portfolio_moments(self, weights):
        """Compute mean and standard deviation of some allocation.

        Parameters
        ----------
        weights : np.array
            1D array representing weights of a portfolio. Has shape `(n_assets,)`.

        Returns
        -------
        mean : float
            Mean (return)
        std : float
            Standard deviation (risk)
        """
        pmean = np.inner(weights, self.mean)
        pmean = pmean.item()
        pvar = weights @ self.covmat @ weights
        pvar = pvar.item()

        return pmean, pvar ** (1 / 2)
def compute_portfolio_moments ( self , weights ) : pmean = np . inner ( weights , self . mean ) pmean = pmean . item ( ) pvar = weights @ self . covmat @ weights pvar = pvar . item ( ) return pmean , pvar ** ( 1 / 2 )