```
> fact.cov <- matrix(NA,ncol(fact.weight),ncol(fact.weight))

> for (row in 15:nrow(fact.weight)) {
    >> fact.cov[[row]] <- var(fact.wealth.return[(row-1):row,])
}

```

When I run this code I get the following error message:

```
Error in fact.cov[[row]] <- var(fact.wealth.return[(row - 1):row, ]) : 
  more elements supplied than there are to replace

```

For each point in time (row), I need to create a covariance matrix. Do someone knows how to do this?

Thank you in advance!