Open lizzieinvancouver opened 3 years ago
@cchambe12 For comparison, here's the results when I randomize leafout date:
> swapre_statrand
X x
1 1 311.0000000
2 2 127.0000000
3 3 1.0000000
4 4 143.1103655
5 5 -2.8707274
6 6 0.3039285
7 7 0.1214731
@cchambe12 Okay! I think I have figured it out:
Best model is selected of the one's climwin says are best across 4 'aggregate statistics.' Taken from Simmons et al. 2019, "The aggregate statistic used in this method is typically a sum, mean (e.g. of the daily mean, minimum, or maximum temperature), minimum (e.g. the minimum mean daily temperature reached in a focal window) or maximum (e.g. the max- imum mean daily temperature reached in a focal window) envi- ronmental value, or the slope of environmental change across the window (the gradient of a linear model of daily mean temperature against date within the focal window).") They are referenced this way in the climwin package:
# 1 = mean
# 2 = max
# 3 = min
# 4 = slope
Some useful to me vignettes are Advanced climwin and just climwin
@lizzieinvancouver Nice! Yes this all looks correct to me, sorry I was late to the party!
@cchambe12 No apologies! It was holidays and you should be taking time off.
I worked on the randomization of leafout date, and on trying the simulated climate data (see sims_sw.R and sims_runsw.R). Sort of tackily I did not write the sims_sw.R to be very automated but it's the parameters in there now, and I either set fstaradjforchill
to 0 or 3 depending on whether there was chill. I ran it with 50 years but interestingly I could not get it to find windows for most of those sims.
Here's a few things I could use help with:
MassWin <- slidingwin(xvar = list(Temp = MassClimate$Temp),
cdate = MassClimate$Date,
bdate = Mass$Date,
baseline = lm(Mass ~ 1, data = Mass),
cinterval = "day",
range = c(150, 0),
upper = 0, binary = TRUE,
type = "absolute", refday = c(20, 05),
stat = "sum",
func = "lin")
Critical next things to do are:
I can help with these, especially putting them on midge so we can free up R space.
Less critical but would be good to do:
Also, it would be nice to fill in the missing climate data ourselves (it's the leap years I think) though not so critical.
Other ideas I have that seem less important now are better fake climate data via a sine curve or such.
From Cat on 10 Dec 2020
I was able to run the sliding windows and---very quick glance---everything looks okay. I split the windows into two: 1950-1983 and 1984-2016 like in the Europe paper. Let me know if you'd like something different!
You can find all of this code in: descend/analyses/pep_analyses/simmonds_slidingwin/
"betpen_climate_slidingwin.R" preps the climate code "bp_sw_simmonds.R" runs the sliding windows
output/results_swapre_bp_mayref.csv: are the results years and mean climate data from the sliding window for the pre cc dataset using May 1 as a reference point output/sumstats_swapre_bp_mayref.csv: are the sliding window summaries for the pre cc dataset using May 1 as a reference point output/results_swapost_bp_mayref.csv: are the results years and mean climate data from the sliding window for the post cc dataset using May 1 as a reference point output/sumstats_swapost_bp_mayref.csv: are the sliding window summaries for the post cc dataset using May 1 as a reference point
@cchambe12 I am playing around with a randomized leafout date, but want to make sure I understand the output from run_SW f(x) correctly. So for example:
So my questions: (1) How do I interpret the window close and open? Are they DOY or relative to something. If they are DOY then does it mean the window opens on day 74 of the year before leafout and closes in January the next year or what? (2) What is the aggregate statistic number? (3) What is row 6? (4) Are my other assumptions about the rows (slope, intercept etc.) correct?
Thanks for any help!