Questions tagged [covariance-matrix]

113 questions
0
votes
0 answers

Query for Portfolio VaR in SQL Server

I am trying to get log of share prices (matrix) in SQL Server. The column name are dynamic and have been by applying PIVOT DECLARE @cmd AS NVARCHAR(MAX), @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX) SET @cols = (SELECT DISTINCT…
0
votes
0 answers

Convergence issue using a LMM with random intercepts and slopes per patient, and with a continuous AR1 correlation structure

Without providing a reproducible example (because that converged, and my data did not), my data is in a long format and includes 104 patients of which 304 measurements were taken. Most only have 2 measurements (n=68), followed by 5 (n=32), 4 (n=3),…
0
votes
1 answer

Problem with finding covariance matrix for Iris data in R

I keep getting NAs when trying to find the covariance matrix for the Iris data in R. library(ggplot2) library(dplyr) dim(iris) head(iris) numIris <- iris %>% select_if(is.numeric) plot(numIris[1:100,]) Xraw <-…
0
votes
0 answers

Generate numbers on a 2D normal distribution with a given covariance matrix

I want to generate 36 pairs of numbers on a two-dimensional normal distribution with the covariance matrix C = [1, 0.8; 0.8, 1], the expected value vector is the zero vector (μ=0= (0,0)). From what I've learnt so far, a matrix A with covariance…
0
votes
1 answer

Faster Resampling Daily Covariance Matrix (MultiIndex) from Daily to Minutely

I looked at similar answers but could not find one that suits my problem. I have a daily covariance matrix that is constructed as a MultiIndex. It has "k" dates, and for each date "k" it has a matrix of size "n" by "n". The dimensions are…
The User
  • 55
  • 3
  • 11
0
votes
1 answer

How to calculate the covariance matrix of a pyspark dataframe?

I have a big pyspark data frame with the columns as some products and the rows as its prices over time. I need to calculate the covariance matrix of all the products, but the data is too big to convert to a pandas data frame, so I need to do it with…
Macro433
  • 1
  • 2
0
votes
1 answer

How to estimate regression's coefficients defining my own covariance matrix's estimation method or with a given covariance matrix with MATLAB?

Given y the dependent variable nx1 and X the matrix of dimension nxp of independent variables. I am willing to estimate beta coefficients, r-squared, and others linear regression parameters with a given covariance matrix or by defining my own…
0
votes
1 answer

SAS: create covariance matrix with variables

I am working on a project in which we have to do some simulations. I am now at the point I want to use the RandNormal function, to generate multivariate normal data given a vector of means and a covariance matrix. For the covariance matrix, we have…
Katie
  • 131
  • 4
0
votes
1 answer

Estimating parameter covariance matrix when fitting a Generalized Extreme Value (GEV) model using 'extRemes' in R

My question is similar to Error with fitting a Generalized Extreme Value (GEV) using `extRemes` in R?. However, I am fitting non-stationary Generalized Extreme Value (GEV) distribution, i.e., when the location parameter depends on covariates and is…
user111092
  • 33
  • 4
0
votes
1 answer

null aware covariance matrix in KDB

I'm working through Funq by Nick Psaris but need a null aware function for making a covariance matrix. I will use it to create a mahalanobis distance matrix. He supplies some null aware functions: navg = null aware avg nvar null aware var nsvar =…
0
votes
1 answer

How do I display the covariance matrix from proc glimmix or proc mixed?

I am using proc glimmix and proc mixed to run a linear mixed model and am trying to look at the covariance matrix to see if it looks correct. How do I print it to the results?
Sophia
  • 99
  • 5
0
votes
0 answers

SciPi Optimize Curve Fit returns error: OptimizeWarning: Covariance of the parameters could not be estimated

I am trying to apply a model based on this formula: and so I defined it as a function def Amp(angular_freq,N,w0,y,c): return ((N)/(((((angular_freq**2)-(w0)**2)**2)+((y*angular_freq)**2))**0.5))+c This function is applied to a set of data…
sid2001
  • 33
  • 7
0
votes
0 answers

cpp calculate 6x6 Covariance Matrix from two 1x3 arrays

Like title says, I am attempting to calculate the covariance matrix for two 1x3 arrays and get one 6x6 std::array in C++. I need some guidance with my understanding - have looked and not been able to see much in terms of clarity to answer my…
0
votes
0 answers

How to build a covariance matrix from eigen vectors wtih the same size

I have 2 eigen vectors sets X and Y with size=(7,7) (so 7 eigen vectors of 7 components). I am looking for a way to build a covariance matrix from these 2 eigen vectors sets. In a first time, I did the function : # Compute covariance between vectors…
user1773603
0
votes
1 answer

Uncertainties package in Python : use of given covariance matrix to get data uncertainties

I believe that my problem is fairly easy to understand, but I would like to make it very clear, hence the length of this post. My initial situation, which I sum up below, is similar to the one explained in this post…