Thank you for the reply Peter...
Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <hjlont$12j$1@fred.mathworks.com>...
> Kirk wrote:
>
> > 1. I understand that 'mvnrnd' maintains the covariances across variables
> > within a given month, but, does 'mvnrnd' also maintain covariances from
> > month to month along the same variable?
>
> If I understand your description correctly, each month's value will be a 1x4 vector. As you say, the covariance among those four variables will be the 4x4 cov matrix you specify (and the sample cov will approximate that), but the samples are INDEPENDENT from month to month. So, as you appear to be using MVNRND, the answer is no.
>
You understand correctly. And I suspected as much...
> > To say that another way... it is
> > obvious that the variables tmax, tmin, radiation, and precipitation will
> > covary at any timestep (which is to say, a dry July is likely to be a
> > sunny July), However, it is also likely that a hotter than average July
> > is more likely to be followed by a hotter than average August.
>
> In the absence of a trend in the mean, you'll need a more complicated cov structure to model that kind of thing. A moving average, perhaps.
I'm not sure how to handle this... As you imply, things get complicated. Perhaps my first approach should be to try and come up with a test for temporal autocorrelation. Although even this gets tricky, because I am sure that the periodicity of monthly temperatures in the measured climate station data will show a high degree of autocorrelation over the year. Perhaps being able to show a similar degree of autocorrelation in the mvnrnd modeled data would reduce some of my concerns?
>
>
> > 2. Should I be applying the the variance multiplier to all elements of
> > the covariance matrix, or only to the diagonal (variances of the
> > covariance matirx)?
>
> It sounds like what you want is to inflate the variances, while preserving the >correlation.
That is correct. Although to be more specific, I am gradually inflating the variances with a 200 year (2400 month) "ramp".
>That implies that you need to scale the offdiag terms in the cov matrix. I
>believe what you should do is multiply the original cov matrix elementwise by >sqrt(varscale)*sqrt(varscale'), assuming varscale is a col vector. If you have a scalar >scale factor, then it's much simpler  all you need do is scale the entire cov matrix.
I think I have a scalarscalar factor, but I'm not entirely sure what you mean here. Below is an example of my covariance matrix and an example multiplier matrix:
The covariance matrix:
climate_sigma <4x4x12 double>
val(:,:,1) =
1.0000 0.9362 0.9162 0.1859
0.9362 1.0000 0.7189 0.1899
0.9162 0.7189 1.0000 0.1995
0.1859 0.1899 0.1995 1.0000
val(:,:,2) =
1.0000 0.9391 0.8761 0.2509
0.9391 1.0000 0.6589 0.1961
0.8761 0.6589 1.0000 0.3211
0.2509 0.1961 0.3211 1.0000
.
.
.
val(:,:,12) =
1.0000 0.9061 0.6831 0.2267
0.9061 1.0000 0.3790 0.1647
0.6831 0.3790 1.0000 0.2576
0.2267 0.1647 0.2576 1.0000
(climate_sigma gets duplicated with "repmat" to become a <4x4x2400 double> named sigmaPost)
Here is the covariance multiplier:
covarInc7 <4x4x2400 double>
val(:,:,1) =
1.0025 1.0025 1.0025 1.0025
1.0025 1.0025 1.0025 1.0025
1.0025 1.0025 1.0025 1.0025
1.0025 1.0025 1.0025 1.0025
val(:,:,2) =
1.0050 1.0050 1.0050 1.0050
1.0050 1.0050 1.0050 1.0050
1.0050 1.0050 1.0050 1.0050
1.0050 1.0050 1.0050 1.0050
.
.
.
val(:,:,2400) =
7 7 7 7
7 7 7 7
7 7 7 7
7 7 7 7
Then I multiply to two matrices with the .* operator
sigmaPost.*covarInc7; % apply covriance increase here
I think this is what you are referring to when you use the phrase scalarscalar multiplication?
>
> Hope this helps.
