Create new rms2 class for the outcome GWAS of interest
x <- rms2$new("ukb-b-2227") #> API: public: http://gwas-api.mrcieu.ac.uk/ #> Classes 'GwasInfo' and 'data.frame': 1 obs. of 18 variables: #> $ id : chr "ukb-b-2227" #> $ trait : chr "Number of children fathered" #> $ mr : int 1 #> $ sex : chr "Males and Females" #> $ group_name : chr "public" #> $ note : chr "2405: Output from GWAS pipeline using Phesant derived variables from UKBiobank" #> $ ontology : logi NA #> $ population : chr "European" #> $ sample_size: int 209872 #> $ category : chr "Categorical Ordered" #> $ unit : chr "SD" #> $ nsnp : int 9851867 #> $ subcategory: logi NA #> $ priority : int 1 #> $ author : chr "Ben Elsworth" #> $ consortium : chr "MRC-IEU" #> $ build : chr "HG19/GRCh37" #> $ year : int 2018 #>
Get the GWAS hits for that dataset
x$extract_gwashits() #> Found 3 GWAS hits for ukb-b-2227 x$gwashits #> # A tibble: 3 x 12 #> beta chr se p n position id rsid ea nea eaf #> <dbl> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> <chr> <chr> <dbl> #> 1 -0.0193 3 0.00260 1.30e-13<PHONE_NUMBER>0543 ukb-b… rs62… T A 0.617 #> 2 0.0187 7 0.00275 1.10e-11<PHONE_NUMBER>40159 ukb-b… rs69… A G 0.694 #> 3 -0.0167 8 0.00302 2.80e- 8<PHONE_NUMBER>3678 ukb-b… rs23… C T 0.772 #> # … with 1 more variable: trait <chr>
Scan OpenGWAS for associations with the second GWAS hit
x$scan_rsid(x$gwashits$rsid[2]) #> Found 6 associations for rs6968380 x$rsid_scan #> $rs6968380 #> # A tibble: 6 x 12 #> position p se beta n chr id rsid ea nea eaf #> <int> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr> <chr> <chr> <dbl> #> 1 114940159 9.20e-18 8.18e-4 -0.00702 462933 7 ukb-… rs69… A G 0.693 #> 2 114940159 6.50e-10 9.96e-4 0.00615 459600 7 ukb-… rs69… A G 0.693 #> 3 114940159 1.30e- 9 1.24e-3 -0.00751 462434 7 ukb-… rs69… A G 0.693 #> 4 114940159 3.90e- 9 1.07e-3 -0.00629 451893 7 ukb-… rs69… A G 0.693 #> 5 114940159 4.82e- 9 3.19e-3 0.0187 154888 7 ukb-… rs69… A G 0.695 #> 6 114940159 2.20e- 8 1.06e-3 -0.00594 459560 7 ukb-… rs69… A G 0.693 #> # … with 1 more variable: trait <chr>
Perform colocalisation for each of the candidate associations
x$coloc_scan(x$gwashits$rsid[2]) #> coloc analysis of ukb-b-11497 #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> 2.37e-19 4.59e-14 5.81e-08 1.03e-02 9.90e-01 #> [1] "PP abf for shared variant: 99%" #> coloc analysis of ukb-b-698 #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> 2.03e-11 3.93e-06 6.61e-08 1.18e-02 9.88e-01 #> [1] "PP abf for shared variant: 98.8%" #> coloc analysis of ukb-b-223 #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> 2.84e-14 5.51e-09 5.01e-06 9.71e-01 2.92e-02 #> [1] "PP abf for shared variant: 2.92%" #> coloc analysis of ukb-b-13764 #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> 3.52e-11 6.81e-06 7.09e-08 1.27e-02 9.87e-01 #> [1] "PP abf for shared variant: 98.7%" #> coloc analysis of ukb-a-304 #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> 1.27e-10 2.46e-05 5.68e-08 1.00e-02 9.90e-01 #> [1] "PP abf for shared variant: 99%" #> coloc analysis of ukb-b-6991 #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> Warning in sdY.est(d$varbeta, d$MAF, d$N): estimating sdY from maf and varbeta, #> please directly supply sdY if known #> PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> 9.63e-10 1.87e-04 9.19e-08 1.68e-02 9.83e-01 #> [1] "PP abf for shared variant: 98.3%" x$coloc_result #> $rs6968380 #> # A tibble: 6 x 7 #> id nsnps PP.H0.abf PP.H1.abf PP.H2.abf PP.H3.abf PP.H4.abf #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 ukb-b-11497 297 2.37e-19 4.59e-14 0.0000000581 0.0103 0.990 #> 2 ukb-b-698 325 2.03e-11 3.93e- 6 0.0000000661 0.0118 0.988 #> 3 ukb-b-223 324 2.84e-14 5.51e- 9 0.00000501 0.971 0.0292 #> 4 ukb-b-13764 315 3.52e-11 6.81e- 6 0.0000000709 0.0127 0.987 #> 5 ukb-a-304 325 1.27e-10 2.46e- 5 0.0000000568 0.0100 0.990 #> 6 ukb-b-6991 318 9.63e-10 1.87e- 4 0.0000000919 0.0168 0.983
Example of plotting a region (extracts LD matrix)
x$plot_coloc(x$gwashits$rsid[2], x$rsid_scan[[x$gwashits$rsid[2]]]$id[1]) #> Extracting LD matrix for 297 variants #> Please look at vignettes for options on running this locally if you need to run many instances of this command. #> Warning in ieugwasr::ld_matrix(markers[["marker"]], with_alleles = FALSE, : The following variants are not present in the LD reference panel #> rs117161781 #> rs117273777 #> rs117303422 #> rs118169575 #> rs139454624 #> rs139462051 #> rs139500510 #> rs140651620 #> rs141744989 #> rs141995076 #> rs142087962 #> rs142329760 #> rs142372229 #> rs142664107 #> rs143271578 #> rs144588831 #> rs146170513 #> rs151172702 #> rs180940258 #> rs180946512 #> rs181430058 #> rs181494117 #> rs182895259 #> rs183744920 #> rs184050099 #> rs184314722 #> rs185309780 #> rs187219455 #> rs193077931 #> rs2188543 #> rs2396813 #> rs4730672 #> rs558482618 #> rs560974722 #> rs575755508 #> rs71563623 #> rs73200222 #> rs75351137 #> rs75354202 #> rs77870086 #> rs7787817 #> Found 256 variants in LD reference panel #> Loading required package: gassocplot
#> TableGrob (2 x 1) "arrange": 2 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[layout]
#> 2 2 (2-2,1-1) arrange gtable[guide-box]
Perform MR for all the candidate traits (though could also exclude the traits that don’t colocalise)
x$mr(x$gwashits$rsid[2], exclude_rsid_region=TRUE) #> Extracting data for 79 SNP(s) from 1 GWAS(s) #> Harmonising Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 (ukb-b-11497) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs1056688, rs2215552, rs2661798 #> [1] 79 #> [1] 71 #> [1] 71 #> Analysing 'ukb-b-11497' on 'ukb-b-2227' #> Extracting data for 5 SNP(s) from 1 GWAS(s) #> Harmonising How are people in household related to participant: Husband, wife or partner || id:ukb-b-698 (ukb-b-698) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> [1] 5 #> [1] 0 #> [1] 0 #> Extracting data for 35 SNP(s) from 1 GWAS(s) #> Harmonising Current tobacco smoking || id:ukb-b-223 (ukb-b-223) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs58040999 #> [1] 35 #> [1] 34 #> [1] 34 #> Analysing 'ukb-b-223' on 'ukb-b-2227' #> Extracting data for 29 SNP(s) from 1 GWAS(s) #> Harmonising Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> [1] 30 #> [1] 28 #> [1] 27 #> Analysing 'ukb-b-13764' on 'ukb-b-2227' #> Extracting data for 2 SNP(s) from 1 GWAS(s) #> Harmonising Number of children fathered || id:ukb-a-304 (ukb-a-304) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> [1] 2 #> [1] 1 #> [1] 1 #> Analysing 'ukb-a-304' on 'ukb-b-2227' #> Extracting data for 44 SNP(s) from 1 GWAS(s) #> Harmonising Seen doctor (GP) for nerves, anxiety, tension or depression || id:ukb-b-6991 (ukb-b-6991) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> Removing the following SNPs for incompatible alleles: #> rs12159707, rs34555420 #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs2876520, rs393488 #> [1] 46 #> [1] 42 #> [1] 42 #> Analysing 'ukb-b-6991' on 'ukb-b-2227' x$mr_scan[[x$gwashits$rsid[2]]] %>% dplyr::select(exposure, b, se, pval) #> exposure #> 1 Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 #> 2 Current tobacco smoking || id:ukb-b-223 #> 3 Long-standing illness, disability or infirmity || id:ukb-b-13764 #> 4 Number of children fathered || id:ukb-a-304 #> 5 Seen doctor (GP) for nerves, anxiety, tension or depression || id:ukb-b-6991 #> b se pval #> 1 0.02543544 0.05324993 6.328911e-01 #> 2 0.11979905 0.05984600 4.530744e-02 #> 3 0.11398441 0.09027558 2.067232e-01 #> 4 0.96797155 0.13132069 1.692875e-13 #> 5 -0.01317781 0.07362608 8.579511e-01
Perform multivariable MR of candidate traits. Excluding the alternative GWAS of number of children fathered as this is synonymous with the outcome
x$mvmr(x$gwashits$rsid[2], traitlist=x$rsid_scan[[x$gwashits$rsid[2]]]$id[-5]) #> Please look at vignettes for options on running this locally if you need to run many instances of this command. #> Clumping 1, 192 variants, using EUR population reference #> Removing 51 of 192 variants due to LD with other variants or absence from LD reference panel #> Extracting data for 141 SNP(s) from 5 GWAS(s) #> Harmonising Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 (ukb-b-11497) and Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs1056688, rs2215552, rs2661798, rs58040999 #> Harmonising Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 (ukb-b-11497) and Current tobacco smoking || id:ukb-b-223 (ukb-b-223) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs1056688, rs2215552, rs2661798, rs58040999 #> Harmonising Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 (ukb-b-11497) and How are people in household related to participant: Husband, wife or partner || id:ukb-b-698 (ukb-b-698) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs1056688, rs2215552, rs2661798, rs58040999 #> Harmonising Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 (ukb-b-11497) and Seen doctor (GP) for nerves, anxiety, tension or depression || id:ukb-b-6991 (ukb-b-6991) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs1056688, rs2215552, rs2661798, rs58040999 #> Extracting data for 141 SNP(s) from 1 GWAS(s) #> Harmonising Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 (ukb-b-11497) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs1056688, rs2215552, rs2661798, rs58040999 x$mv_dat[[x$gwashits$rsid[2]]][["result"]][[1]] %>% dplyr::select(exposure, b, se, pval) #> exposure #> 1 Operation code: tonsillectomy +/- adenoids || id:ukb-b-11497 #> 2 Long-standing illness, disability or infirmity || id:ukb-b-13764 #> 3 Current tobacco smoking || id:ukb-b-223 #> 4 How are people in household related to participant: Husband, wife or partner || id:ukb-b-698 #> 5 Seen doctor (GP) for nerves, anxiety, tension or depression || id:ukb-b-6991 #> b se pval #> 1 -0.003478738 0.06497898 9.573046e-01 #> 2 0.093665403 0.09138850 3.054035e-01 #> 3 0.222608807 0.08616459 9.779497e-03 #> 4 1.457358841 0.18169451 1.049481e-15 #> 5 0.123356060 0.10108759 2.223554e-01
Perform feature selection and re-estimate associations after that. It updates the result from the standard MVMR analysis
x$mvmr_lasso(x$gwashits$rsid[2]) #> Performing feature selection #> Please look at vignettes for options on running this locally if you need to run many instances of this command. #> Clumping 1, 114 variants, using EUR population reference #> Removing 32 of 114 variants due to LD with other variants or absence from LD reference panel #> Extracting data for 82 SNP(s) from 4 GWAS(s) #> Harmonising Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) and Current tobacco smoking || id:ukb-b-223 (ukb-b-223) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs2876520, rs58040999 #> Harmonising Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) and How are people in household related to participant: Husband, wife or partner || id:ukb-b-698 (ukb-b-698) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs2876520, rs58040999 #> Harmonising Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) and Seen doctor (GP) for nerves, anxiety, tension or depression || id:ukb-b-6991 (ukb-b-6991) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs2876520, rs58040999 #> Extracting data for 82 SNP(s) from 1 GWAS(s) #> Harmonising Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) and Number of children fathered || id:ukb-b-2227 (ukb-b-2227) #> Removing the following SNPs for being palindromic with intermediate allele frequencies: #> rs10143492, rs2876520, rs58040999 x$mv_dat[[x$gwashits$rsid[2]]][["result"]][[1]] %>% dplyr::select(exposure, b, se, pval) #> exposure #> 1 Long-standing illness, disability or infirmity || id:ukb-b-13764 #> 2 Current tobacco smoking || id:ukb-b-223 #> 3 How are people in household related to participant: Husband, wife or partner || id:ukb-b-698 #> 4 Seen doctor (GP) for nerves, anxiety, tension or depression || id:ukb-b-6991 #> b se pval #> 1 0.07153219 0.09862285 4.682616e-01 #> 2 0.20287671 0.08644674 1.893336e-02 #> 3 1.52946203 0.20730583 1.609203e-13 #> 4 0.14516472 0.10670644 1.736996e-01
Note that this might lead to under-estimated standard errors so it should be used for estimation rather than hypothesis testing


FutureResult
public enum FutureResult<T>
Defines a simple enumeration of the legal Completion states of a Future.
- case Success(T): the Future has completed Succesfully.
- case Fail(ErrorType): the Future has failed.
- case Cancelled: the Future was cancelled. This is typically not seen as an error.
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
returns a .Fail(FutureNSError) with a simple error string message.
Declaration
Swift
public init(failWithErrorMessage : String)
-
converts an NSException into an NSError. useful for generic Objective-C excecptions into a Future
Declaration
Swift
public init(exception ex:NSException)
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
make sure this enum is a .Success before calling
result
. Do a check ‘completion.state {}` or .isFail() first.Declaration
Swift
public var value : T!
-
make sure this enum is a .Fail before calling
result
. Use a switch or check .isError() first.Declaration
Swift
public var error : ErrorType!
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
convert this completion of type Completion
into another type Completion .may fail to compile if T is not convertable into S using
`as!`
works iff the following code works:
‘let t : T`
‘let s = t as! S’
- example:
let c : FutureResult<Int> = .Success(5)
let c2 : FutureResult<Int32> = c.As()
assert(c2.result == Int32(5))
you will need to formally declare the type of the new variable, in order for Swift to perform the correct conversion.
Declaration
Swift
public func As<S>() -> FutureResult<S>
-
convert this completion of type Completion
into another type Completion .may fail to compile if T is not convertable into S using
`as!`
works iff the following code works:
‘let t : T`
‘let s = t as! S’
- example:
let c : FutureResult<Int> = .Success(5)
let c2 : FutureResult<Int32> = c.As()
assert(c2.result == Int32(5))
you will need to formally declare the type of the new variable, in order for Swift to perform the correct conversion.
Declaration
Swift
public func mapAs<S>() -> FutureResult<S>
-
convert this completion of type
Completion<T>
into another typeCompletion<S?>
.WARNING: if
T as! S
isn’t legal, than all Success values may be converted to nil - example:let c : FutureResult
= .Success( 5
) let c2 : FutureResult<[Int]?> = c.convertOptional() assert(c2.result == nil)you will need to formally declare the type of the new variable, in order for Swift to perform the correct conversion.
Declaration
Swift
public func convertOptional<S>() -> FutureResult<S?>
Return Value
a new result of type Completion
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>
-
Undocumented
Declaration
Swift
public enum FutureResult<T>


There might be many methods for all the different types of people ot there ro tackle this, but the one I found the most interesting was stargazing, it has always been fascinating to me. I especially like the fact that you can do it from anywhere in the world as long as it gets dark enough. It's a great activity to enjoy by yourself or even with other people and you don't even need to know about astronomy to enjoy it, it's up to you if you want to learn the names of the constellations or just feel yourself get swept away with the mesmerizing view thats right in front of you.
I know a lot of people might not be on board with the idea of just laying on the ground and start gazing at the sky with no other purpose and that's ok, but just remember that it is also ok to give new ideas a try. In my experience there has been nothing more relaxing than staring at the sky whilst thinking to myself about anything and everything.
And of course gazing and talking with your friends is also allowed and stress relieving, finding the different constellations or just imagining all sorts of shapes, letting your imagination run wild, I love that feeling.
Anyway, this are just some random thoughts that I wanted to share with the world, I hope you enjoyed them and have a swell time stargazing in your own town.
If you're still unsure as to how to even begin to stargaze by yourself I advise you to read Shelby Brown's blog on the newest most popular apps on stargazing available for download at the moment:
Now, here are a few videos that actually get me in the mood to start stargazing that I thought you might like:
[Getting started with Stargazing]
[Kygo/Stargazing]
Hope you enjoy!


The MovingAverage object calculates the average value of the input over a given time interval.
y = { x + Σ(i = M to M-N-2) X(i) } / N
where:
y = present output value for the MovingAverage object
x = present input to the MovingAverage object
N = NumberOfSamples
M = number of updates that have been performed previously
X(i) = input to the MovingAverage object at the ith update time
The value returned by the MovingAverage object is calculated on demand. The update signal received from the Controller is used only to record the values X(i) used in the calculation.


PSALMS 14
A psalm written by David for the choir director
1 Only foolish people say to themselves, "There is no God!"
People who say those things only do corrupt deeds;
there is not one of them who does what is good.
2 From heaven Yahweh looks down at everyone;
he looks to see if anyone is very wise,
wise enough to desire to know him.
3 But they are all corrupt;
no one does what is good.
4 Will those evil people never learn what God will do to punish them?
They act violently toward Yahweh's people and want to consume them like one who eats food consumes it,
and they never pray to Yahweh.
5 But some day they will become very terrified
because God helps those who act righteously and will punish those who reject him.
6 Those who do evil may prevent helpless people from doing what they plan to do,
but Yahweh protects them.
7 Is there anyone for Yahweh to send to help the Israelite people on behalf of Yahweh?
Yahweh, when you bless your people again,
all of us Israelite people, who are the descendants of Jacob, will rejoice.


Let me say, that first of all, for my age (15) I am a moderately experienced drug user with a pretty vast knowledge of psychoactives. My 'resume' of substance use includes marijuana, alcohol, cocaine, heroin, opium, Datura, Ecstasy, LSD, diazepam, hydrocodone, oxycodone, alprazolam, clonazepam, and DXM. Marijuana is by far my drug of choice, but I see fit for myself to experiment.
One drug that I have always been curious about was speed, especially in the form of amphetamines. I had read about it, researched it thoroughly, but I never had the chance to try it for myself. That is, until yesterday. My close friend, who always seems to have a stockpile of pharmaceutical drugs, informed me that she had 20 milligram Adderall tablets that she wanted to sell. I gleefully accepted this offer, especially since she was selling them for $1 each. I bought 4 tablets. I recognized them immediately by their pale orange color and imprint, 'AD'.
I decided to pop all of them (a total of 80 milligrams) last night at 9:00 PM. I also skipped my daily dose of Celexa, which I take for depression, because I was unsure whether amphetamine would interfere with it.
So, I waited. Forty-five minutes breezed by - and that's when I started feeling the speed kick.
First came the jittery movements, the clearer thinking, and rapid talking. Almost like caffiene, I thought. Yet, as each minute passed by, I felt more and more euphoric. My confidence skyrocketed. Suddenly, I had a replenished and passionate interest in everything I did. I had a lively conversation with my younger brother, asking him tons of questions about everything and anything. When I looked in the mirror, I was beautiful despite my flaws. I immediately noticed that my pupils were enormously dilated (which I read was a common effect of speed). I didn't care.  I stayed up until 1:00 AM perfecting every detail of my homework, writing endless letters to my friends, reading my assigned English book twice (which was 125 pages) with extreme fervor.
At 1:30 AM, I retired to my bed (certainly not because I was tired, but because I didn't want my parents suspicious). With my jaw being clenched at full force and my uncontrollable lip twitching, my hands wandered around my cluttered desk until I found some chewing gum. I shoved 3 sticks of gum into my mouth and chewed anxiously. After about 15 minutes, I decided my wad of gum was lacking flavor. I chucked the enormous, chewed-up wad into the trash and started on 3 new pieces of gum.
All night long I did this. Chewing on gum, for hours at a time, until my jaw and tongue were raw and sore. I didn't really notice it - I was much too tweaked out. I didn't sleep one second last night. It was impossible. I was boiling over with energy and sporadic thoughts. Compulsively, I checked my watch every ten minutes.
I started getting ready for school at 6:00 PM.  Crashing on speed is a horrible, horrible feeling. My heart beat was very rapid, my breathing was sporadic and shallow. My pupils were still dilated to the max. My jaw and tongue were raw and painful from hours of gum-chewing. Sweat flooded from my skin as if I were in 90-degree weather. Dehydration was setting in.
As I arrived at school, I felt mentally and physically burnt. I bought some juice (which I gulped down). My friends noticed my pupils were dilated, and that I had dark circles under my eyes. I was also wearing the same clothes from the day before. I didn't even think to brush my hair. Yes, I was truly a mess this morning.
An easy conclusion is hard to derive from one experience with amphetamine.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


|
GenericMatrix
A generic template matrix class.
|
The GenericMatrix2 class defines a generic template matrix class, the matrix elements are managed by a two-dimension pointer. More...
#include <GenericMatrix2.h>
Public Types | |
| using | size_type = std::size_t |
| using | value_type = Elem |
Public Member Functions | |
| GenericMatrix2 () | |
| GenericMatrix2 (size_type row, size_type col) | |
| GenericMatrix2 (size_type row, size_type col, const Elem &initialValue) | |
| GenericMatrix2 (const GenericMatrix2 &other) | |
| GenericMatrix2 (GenericMatrix2 &&other) noexcept | |
| ~GenericMatrix2 () | |
| GenericMatrix2 & | operator= (const GenericMatrix2 &other) |
| GenericMatrix2 & | operator= (GenericMatrix2 &&other) noexcept |
| size_type | rows () const |
| size_type | columns () const |
| size_type | size () const |
| Elem ** | data () |
| const Elem *const * | data () const |
| const Elem *const * | constData () const |
| Elem * | operator[] (size_type row) |
| const Elem * | operator[] (size_type row) const |
| Elem * | rowData (size_type row) |
| const Elem * | rowData (size_type row) const |
| const Elem * | constRowData (size_type row) const |
| Elem * | at (size_type row) |
| const Elem * | at (size_type row) const |
| Elem & | operator() (size_type row, size_type col) |
| const Elem & | operator() (size_type row, size_type col) const |
| Elem & | at (size_type row, size_type col) |
| const Elem & | at (size_type row, size_type col) const |
| bool | empty () const |
| bool | isValid () const |
| bool | isIdentity () const |
| bool | isHomomorphicTo (const GenericMatrix2< Elem > &m) |
| void | resize (size_type row, size_type col) |
| void | resize (size_type row, size_type col, const Elem &initialValue) |
| void | setToIdentity () |
| void | fill (const Elem &value) |
| void | swap (GenericMatrix2< Elem > &other) |
| GenericMatrix2< Elem > | transposed () const |
| void | doHadamardProduct (const GenericMatrix2< Elem > &m) |
| GenericMatrix2< Elem > & | operator+= (const GenericMatrix2< Elem > &m) |
| GenericMatrix2< Elem > & | operator-= (const GenericMatrix2< Elem > &m) |
| GenericMatrix2< Elem > & | operator *= (const GenericMatrix2< Elem > &m) |
| GenericMatrix2< Elem > & | operator *= (const Elem &factor) |
| GenericMatrix2< Elem > & | operator/= (const Elem &divisor) |
| bool | operator== (const GenericMatrix2< Elem > &m) const |
| bool | operator!= (const GenericMatrix2< Elem > &m) const |
Static Public Member Functions | |
| static bool | isHomomorphic (const GenericMatrix2< Elem > &m1, const GenericMatrix2< Elem > &m2) |
| static GenericMatrix2< Elem > | hadamardProduct (const GenericMatrix2< Elem > &m1, const GenericMatrix2< Elem > &m2) |
Friends | |
| template<typename __ElemDTo , typename __Elem > | |
| GenericMatrix2< __ElemDTo > | matrix_cast (const GenericMatrix2< __Elem > &m) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator+ (const GenericMatrix2< __Elem > &m1, const GenericMatrix2< __Elem > &m2) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator- (const GenericMatrix2< __Elem > &m1, const GenericMatrix2< __Elem > &m2) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator * (const GenericMatrix2< __Elem > &m1, const GenericMatrix2< __Elem > &m2) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator * (const GenericMatrix2< __Elem > &matrix, const __Elem &factor) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator * (const __Elem &factor, const GenericMatrix2< __Elem > &matrix) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator/ (const GenericMatrix2< __Elem > &matrix, const __Elem &divisor) |
| template<typename __Elem > | |
| GenericMatrix2< __Elem > | operator- (const GenericMatrix2< __Elem > &matrix) |
| template<typename __Elem > | |
| std::ostream & | operator<< (std::ostream &os, const GenericMatrix2< __Elem > &matrix) |
The GenericMatrix2 class defines a generic template matrix class, the matrix elements are managed by a two-dimension pointer.
The GenericMatrix2 template has one parameter:
Definition at line 38 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::size_type |
Type for declaring the matrix's rows and columns.
Definition at line 41 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::value_type |
The value type of the template parameter Elem.
Definition at line 42 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::GenericMatrix2 | ( | ) |
| GenericMatrix2< Elem >::GenericMatrix2 | ( | size_type | row, |
| size_type | col | ||
| ) |
Constructs a row x col matrix without initializing the contents.
Definition at line 154 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::GenericMatrix2 | ( | size_type | row, |
| size_type | col, | ||
| const Elem & | initialValue | ||
| ) |
Constructs a row x col matrix and initialize all values with initialValue.
Definition at line 166 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::GenericMatrix2 | ( | const GenericMatrix2< Elem > & | other | ) |
Constructs a copy of other.
Definition at line 221 of file GenericMatrix2.h.
|
noexcept |
Move-constructs a GenericMatrix2 instance, making it point at the same object that other was pointing to.
Definition at line 236 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::~GenericMatrix2 | ( | ) |
Destroys the matrix.
Definition at line 177 of file GenericMatrix2.h.
| Elem * GenericMatrix2< Elem >::at | ( | size_type | row | ) |
Returns a pointer to the row data of this matrix, with bounds checking.
| std::out_of_range | if position row is not within the range of the matrix. |
Definition at line 429 of file GenericMatrix2.h.
| const Elem * GenericMatrix2< Elem >::at | ( | size_type | row | ) | const |
Returns a constant pointer to the row data of this matrix, with bounds checking.
| std::out_of_range | if position row is not within the range of the matrix. |
Definition at line 444 of file GenericMatrix2.h.
| Elem & GenericMatrix2< Elem >::at | ( | size_type | row, |
| size_type | col | ||
| ) |
Returns a reference to the element at position (row, column) in this matrix, with bounds checking.
| std::out_of_range | if position (row, col) is not within the range of the matrix. |
Definition at line 503 of file GenericMatrix2.h.
| const Elem & GenericMatrix2< Elem >::at | ( | size_type | row, |
| size_type | col | ||
| ) | const |
Returns a constant reference to the element at position (row, column) in this matrix, with bounds checking.
| std::out_of_range | if position (row, col) is not within the range of the matrix. |
Definition at line 487 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::size_type GenericMatrix2< Elem >::columns | ( | ) | const |
Returns the number of matrix columns.
Definition at line 307 of file GenericMatrix2.h.
| const Elem *const * GenericMatrix2< Elem >::constData | ( | ) | const |
Returns a constant pointer to the raw data of this matrix.
Definition at line 351 of file GenericMatrix2.h.
| const Elem * GenericMatrix2< Elem >::constRowData | ( | size_type | row | ) | const |
Returns a constant pointer to the row data of this matrix.
Definition at line 416 of file GenericMatrix2.h.
| Elem ** GenericMatrix2< Elem >::data | ( | ) |
Returns a pointer to the raw data of this matrix.
Definition at line 329 of file GenericMatrix2.h.
| const Elem *const * GenericMatrix2< Elem >::data | ( | ) | const |
Returns a constant pointer to the raw data of this matrix.
Definition at line 340 of file GenericMatrix2.h.
| void GenericMatrix2< Elem >::doHadamardProduct | ( | const GenericMatrix2< Elem > & | m | ) |
Do the hadamard product of this matrix and the matrix m.
| std::invalid_argument | if m1 and m2 are not homomorphic. |
Definition at line 626 of file GenericMatrix2.h.
| bool GenericMatrix2< Elem >::empty | ( | ) | const |
Returns true
if this matrix element's size equal to 0, otherwise returns false
.
Definition at line 515 of file GenericMatrix2.h.
| void GenericMatrix2< Elem >::fill | ( | const Elem & | value | ) |
Fills all elements of this matrix with value.
Definition at line 612 of file GenericMatrix2.h.
|
static |
Returns the hadamard product of the matrix m1 and the matrix m2.
| std::invalid_argument | if m1 and m2 are not homomorphic. |
Definition at line 646 of file GenericMatrix2.h.
|
inlinestatic |
Returns true
if matrix m1 and matrix m2 are homomorphic; false otherwise.
Definition at line 677 of file GenericMatrix2.h.
|
inline |
Returns true
if this matrix and matrix m are homomorphic; false otherwise.
Definition at line 666 of file GenericMatrix2.h.
| bool GenericMatrix2< Elem >::isIdentity | ( | ) | const |
Returns true
if this matrix is the identity; false otherwise.
Definition at line 535 of file GenericMatrix2.h.
| bool GenericMatrix2< Elem >::isValid | ( | ) | const |
Returns true
if this matrix internal data is not null pointer and matrix rows/cols greater than 0, otherwise returns false
.
Definition at line 524 of file GenericMatrix2.h.
| GenericMatrix2< Elem > & GenericMatrix2< Elem >::operator *= | ( | const GenericMatrix2< Elem > & | m | ) |
Multiplies this matrix and matrix m, in format: this = this * m.
| std::invalid_argument | if this matrix's columns is not equal to matrix m's rows. |
Definition at line 739 of file GenericMatrix2.h.
| GenericMatrix2< Elem > & GenericMatrix2< Elem >::operator *= | ( | const Elem & | factor | ) |
Multiplies all elements of this matrix by factor.
Definition at line 761 of file GenericMatrix2.h.
| bool GenericMatrix2< Elem >::operator!= | ( | const GenericMatrix2< Elem > & | m | ) | const |
Returns true
if this matrix is not identical to m; false otherwise.
Definition at line 810 of file GenericMatrix2.h.
| Elem & GenericMatrix2< Elem >::operator() | ( | size_type | row, |
| size_type | column | ||
| ) |
Returns a reference to the element at position (row, column) in this matrix so that the element can be assigned to.
Definition at line 473 of file GenericMatrix2.h.
| const Elem & GenericMatrix2< Elem >::operator() | ( | size_type | row, |
| size_type | column | ||
| ) | const |
Returns a constant reference to the element at position (row, column) in this matrix.
Definition at line 459 of file GenericMatrix2.h.
| GenericMatrix2< Elem > & GenericMatrix2< Elem >::operator+= | ( | const GenericMatrix2< Elem > & | m | ) |
Adds the contents of m to this matrix.
| std::invalid_argument | if this matrix and matrix m are not homomorphic. |
Definition at line 699 of file GenericMatrix2.h.
| GenericMatrix2< Elem > & GenericMatrix2< Elem >::operator-= | ( | const GenericMatrix2< Elem > & | m | ) |
Subtracts the contents of m from this matrix.
| std::invalid_argument | if this matrix and matrix m are not homomorphic. |
Definition at line 720 of file GenericMatrix2.h.
| GenericMatrix2< Elem > & GenericMatrix2< Elem >::operator/= | ( | const Elem & | divisor | ) |
Divides all elements of this matrix by divisor.
Definition at line 777 of file GenericMatrix2.h.
| GenericMatrix2< Elem > & GenericMatrix2< Elem >::operator= | ( | const GenericMatrix2< Elem > & | other | ) |
Assigns other to this matrix and returns a reference to this matrix.
Definition at line 248 of file GenericMatrix2.h.
|
noexcept |
Move-assigns other to this GenericMatrix2 instance.
Definition at line 273 of file GenericMatrix2.h.
| bool GenericMatrix2< Elem >::operator== | ( | const GenericMatrix2< Elem > & | m | ) | const |
Returns true
if this matrix is identical to m; false otherwise.
Definition at line 793 of file GenericMatrix2.h.
| Elem * GenericMatrix2< Elem >::operator[] | ( | size_type | row | ) |
Returns a pointer to the row data of this matrix.
Definition at line 364 of file GenericMatrix2.h.
| const Elem * GenericMatrix2< Elem >::operator[] | ( | size_type | row | ) | const |
Returns a pointer to the row data of this matrix.
Definition at line 377 of file GenericMatrix2.h.
| void GenericMatrix2< Elem >::resize | ( | size_type | row, |
| size_type | col | ||
| ) |
Reconstructs a row x col matrix without initializing the contents.
Definition at line 555 of file GenericMatrix2.h.
| void GenericMatrix2< Elem >::resize | ( | size_type | row, |
| size_type | col, | ||
| const Elem & | initialValue | ||
| ) |
Reconstructs a row x col matrix and initialize all values with initialValue.
Definition at line 568 of file GenericMatrix2.h.
| Elem * GenericMatrix2< Elem >::rowData | ( | size_type | row | ) |
Returns a pointer to the row data of this matrix.
Definition at line 390 of file GenericMatrix2.h.
| const Elem * GenericMatrix2< Elem >::rowData | ( | size_type | row | ) | const |
Returns a constant pointer to the row data of this matrix.
Definition at line 403 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::size_type GenericMatrix2< Elem >::rows | ( | ) | const |
Returns the number of matrix rows.
Definition at line 296 of file GenericMatrix2.h.
| void GenericMatrix2< Elem >::setToIdentity | ( | ) |
Sets this matrix to the identity.
Definition at line 580 of file GenericMatrix2.h.
| GenericMatrix2< Elem >::size_type GenericMatrix2< Elem >::size | ( | ) | const |
Returns the number of matrix elements.
Definition at line 318 of file GenericMatrix2.h.
| void GenericMatrix2< Elem >::swap | ( | GenericMatrix2< Elem > & | other | ) |
Swaps matrix other with this matrix.
Definition at line 686 of file GenericMatrix2.h.
| GenericMatrix2< Elem > GenericMatrix2< Elem >::transposed | ( | ) | const |
Returns this matrix, transposed about its diagonal.
Definition at line 597 of file GenericMatrix2.h.
|
friend |
Converts a matrix to a different type matrix.
static_cast<__ElemDst>(__Elem)
. Definition at line 833 of file GenericMatrix2.h.
|
friend |
Returns the product of the M1xNN
matrix m1 and the NNxM2
matrix m2 to produce a M1xM2
matrix result.
| std::invalid_argument | if m1's columns is not equal to matrix m2's rows. |
Definition at line 900 of file GenericMatrix2.h.
|
friend |
Returns the result of multiplying all elements of matrix by factor.
Definition at line 923 of file GenericMatrix2.h.
|
friend |
Returns the result of multiplying all elements of matrix by factor.
Definition at line 941 of file GenericMatrix2.h.
|
friend |
Returns the sum of m1 and m2.
| std::invalid_argument | if this matrix and matrix m are not homomorphic. |
Definition at line 853 of file GenericMatrix2.h.
|
friend |
Returns the difference of m1 and m2.
| std::invalid_argument | if this matrix and matrix m are not homomorphic. |
Definition at line 876 of file GenericMatrix2.h.
|
friend |
Returns the negation of matrix.
Definition at line 977 of file GenericMatrix2.h.
|
friend |
Returns the result of dividing all elements of matrix by divisor.
Definition at line 959 of file GenericMatrix2.h.
|
friend |
Writes the given matrix to the given stream and returns a reference to the stream.
Definition at line 996 of file GenericMatrix2.h.


--- title: "Session 04 - Instrumental Variables" date: '2020-09-22' output: html_document: toc: TRUE number_sections: FALSE highlight: tango theme: cosmo toc_depth: 3 toc_float: true ---
Today we will have a look at instrumental variables. We will explore encouragement experimental designs and how IVs can be used in observational data settings. Additionally, we will learn how to calculate our LATE manually with the wald estimator and in R with two-stage square least regressions through ivreg
Imagine that the organization you work for is laying out a project to distribute mosquito nets to help combat malaria transmitions. You are in charge of running the impact evaluation of this program. You realize that it is unethical to randomize who receives the nets, so you consider an encouragement design.  (This example is using simulated data)
For this evaluation to render credible results we need to fulfill a certain set of assumtions:
a) Relevance: Also known as non-zero average encouragement effect. Does our \(Z\) create variation in our \(D\)? In other words, is the mosquito net use different under the encouragement group? (Statistically testable)
b) Exogeneity/Ignorability of the instrument: Potential outcomes and treatments are independent of \(Z\). In this case given by out randomization of encouragement by villages.
c) Exclusion restriction: The instrument only affects the outcome via the treatment. In other words, there are no alternative paths through which our SMS can have an effect on malaria infections other that the use of the mosquito nets.
d) Monotonicity: No defiers. We assume that non-compliers fall in the camp of always- and never-takers. We would not expect subjects who when encouraged would not use the nets, but would use them if they did not recieve the SMS reminder.
library(dplyr) # for data wrangling
library(readr) # for loading the .csv data
library(ggplot2) # for creating plots
library(summarytools) # for ctable()
library(stargazer) # for formatting model output
library(kableExtra) # for formatting data frames
library(AER) # for ivreg()
library(tidyr) # for pivot_wider()
set.seed(123) # for consistent results
eval_data <- readr::read_csv("https://raw.githubusercontent.com/seramirezruiz/stats-ii-lab/master/Session%205/data/evaluation_data.csv") # loading simulated data frame of the intervention
You receive the results of your intervention from the M&E officers. This is what they look like:
summarytools::st_options(footnote = NA) # to get rid of the footnote of ctable
print(summarytools::ctable(eval_data$net_use, eval_data$sms, prop = "n"),
method = "render") # include results = "asis" to view html in the knitted file
| sms | |||
|---|---|---|---|
| net_use | 0 | 1 | Total |
| 0 | 335 | 110 | 445 |
| 1 | 165 | 390 | 555 |
| Total | 500 | 500 | 1000 |
a) Where are our compliers and non-compliers?
b) How many people were encouraged via SMS, but did not use the net?
c) How many people were not encouraged via SMS, yet they utilized the net?
We can also utilize dplyr to check the average malaria on each stratum:
eval_data %>%
dplyr::group_by(net_use, sms) %>% #group our data on the tratment and instrument
dplyr::summarize(avg = mean(malaria)) %>% #get the aveage value of malaria
dplyr::mutate(avg = round(avg, 2)) %>% #round the avg to 2 decimal places
tidyr::pivot_wider(names_from = sms, values_from = avg) %>% #convert to wide format
knitr::kable() %>% #turn to kable
kableExtra::kable_styling() %>%
kableExtra::add_header_above(c("", "sms" = 2)) #add header for sms
| net_use | 0 | 1 |
|---|---|---|
| 0 | 0.73 | 0.55 |
| 1 | 0.05 | 0.08 |
Additionally, we can explore our data visually to check beyond compliance and see in which groups malaria was present. In this case, we are dealing with binary outcomes. That is, you can either be or not be infected, which are represented by the color dimension in different groups.
ggplot(eval_data, aes(x = factor(sms),
y = factor(net_use),
color = factor(malaria))) +
geom_point() +
geom_jitter() +
theme_minimal() +
scale_x_discrete(labels = c("SMS = 0", "SMS = 1")) +
scale_y_discrete(labels = c("NET = 0", "NET = 1")) +
scale_color_discrete(labels = c("Not infected", "Infected")) +
labs(x = "Encouragement",
y = "Treatment",
color = "")
In other words, we are looking at the relevance assumption. Does our SMS encouragement create changes in our mosquito net use?
summary(lm(net_use ~ sms, eval_data))
##
## Call:
## lm(formula = net_use ~ sms, data = eval_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.78 -0.33 0.22 0.22 0.67
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.33000 0.01984 16.64 <2e-16 ***
## sms 0.45000 0.02805 16.04 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4436 on 998 degrees of freedom
## Multiple R-squared: 0.205, Adjusted R-squared: 0.2042
## F-statistic: 257.3 on 1 and 998 DF, p-value: < 2.2e-16
Economists have established as a "rule-of-thumb" for the case of a single endogenous regressor to be considered a strong instrument should have a F-statistic 1 greater than 10. From this regression, we can see that SMS encouragement is a strong instrument. Additionally, the substantive read in this case is that only 33% of those who did not receive the SMS utilized the mosquito nets, where as 78% of those who got the SMS encouragement did.
Also, why do you think we call this a naïve estimate?
naive_model <- lm(malaria ~ net_use, eval_data)
summary(naive_model)
##
## Call:
## lm(formula = malaria ~ net_use, data = eval_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.68315 -0.06847 -0.06847 0.31685 0.93153
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.68315 0.01722 39.67 <2e-16 ***
## net_use -0.61468 0.02312 -26.59 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3633 on 998 degrees of freedom
## Multiple R-squared: 0.4147, Adjusted R-squared: 0.4141
## F-statistic: 707 on 1 and 998 DF, p-value: < 2.2e-16
This is the effect that our SMS encouragement had on malaria infections. \(ITT = E(Malaria_i|SMS=1) - E(Malaria_i|SMS=0)\). What does this tell us?
itt_model <- lm(malaria ~ sms, eval_data)
summary(itt_model)
##
## Call:
## lm(formula = malaria ~ sms, data = eval_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.504 -0.180 -0.180 0.496 0.820
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.50400 0.01996 25.25 <2e-16 ***
## sms -0.32400 0.02823 -11.48 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4463 on 998 degrees of freedom
## Multiple R-squared: 0.1166, Adjusted R-squared: 0.1157
## F-statistic: 131.8 on 1 and 998 DF, p-value: < 2.2e-16
We have several options for this:
| sms | |||
|---|---|---|---|
| net_use | 0 | 1 | Total |
| 0 | 335 | 110 | 445 |
| 1 | 165 | 390 | 555 |
| Total | 500 | 500 | 1000 |
Let's take a look at our numerator \(cov(Y_i,Z_i)\)
\(E(Y|Z = 1)\) = 0.18
\(E(Y|Z = 0)\) = 0.504
Let's take a look at our denominator \(cov(D_i,Z_i)\)
\(E(D ∣ Z = 1) = \frac{390}{(390 + 110)} = 0.78\)
\(E(D ∣ Z = 0) = \frac{165}{(165 + 335)} = 0.33\)
We can calculate our LATE \[LATE = \frac{(0.18 - 0.504)}{(0.78 - 0.33)} = -0.72\]
AER
package. It fits instrumental-variable regression through two-stage least squares. The syntax is the following:
late_model <- AER::ivreg(malaria ~ net_use | sms, data = eval_data)
summary(late_model)
##
## Call:
## AER::ivreg(formula = malaria ~ net_use | sms, data = eval_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.7416 -0.0216 -0.0216 0.2584 0.9784
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.74160 0.03089 24.00 <2e-16 ***
## net_use -0.72000 0.05159 -13.96 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3671 on 998 degrees of freedom
## Multiple R-Squared: 0.4025, Adjusted R-squared: 0.4019
## Wald test: 194.8 on 1 and 998 DF, p-value: < 2.2e-16
What ivreg() is doing in the background is the following:
net_use_hat <- lm(net_use ~ sms, eval_data)$fitted.values # get fitted values from first stage (the part of x that is exogenously driven by z)
summary(lm(eval_data$malaria ~ net_use_hat)) # run second stage with instrumented x (careful, the standard errors are wrong; better use ivreg() from AER instead)
##
## Call:
## lm(formula = eval_data$malaria ~ net_use_hat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.504 -0.180 -0.180 0.496 0.820
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.74160 0.03757 19.74 <2e-16 ***
## net_use_hat -0.72000 0.06273 -11.48 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4463 on 998 degrees of freedom
## Multiple R-squared: 0.1166, Adjusted R-squared: 0.1157
## F-statistic: 131.8 on 1 and 998 DF, p-value: < 2.2e-16
We can also adapt the ivreg() syntax to accomodate valid conditional instruments:
An F statistic is a value you get when you run an ANOVA test or a regression analysis to find out if the means between two populations are significantly different. It’s similar to a t-statistic from a t-test; A-T test will tell you if a single variable is statistically significant and an F test will tell you if a group of variables are jointly significant.↩


Public Member Functions | |
| virtual D_COLLISION_API ndBodyKinematic * | GetBody0 () const |
| virtual D_COLLISION_API ndBodyKinematic * | GetBody1 () const |
| D_COLLISION_API void | AttachToBodies () |
| D_COLLISION_API void | DetachFromBodies () |
| ndContact * | GetAsContact () |
| virtual ndUnsigned32 | GetRowsCount () const |
| const ndMaterial * | GetMaterial () const |
| virtual void | JacobianDerivative (ndConstraintDescritor &desc) |
| virtual void | JointAccelerations (ndJointAccelerationDecriptor *const desc) |
| ndContactPointList & | GetContactPoints () |
| const ndContactPointList & | GetContactPoints () const |
| bool | IsSkeletonSelftCollision () const |
| bool | IsSkeletonIntraCollision () const |
| Public Member Functions inherited from ndConstraint | |
| D_CLASS_REFLECTION (ndConstraint) | |
| virtual ndJointBilateralConstraint * | GetAsBilateral () |
| bool | IsActive () const |
| void | SetActive (bool state) |
| virtual bool | IsBilateral () const |
| virtual void | DebugJoint (ndConstraintDebugCallback &) const |
| void | InitPointParam (ndPointParam ¶m, const ndVector &p0Global, const ndVector &p1Global) const |
| Public Member Functions inherited from ndFreeListAlloc | |
| D_CORE_API void * | operator new (size_t size) |
| D_CORE_API void | operator delete (void *ptr) |
Friends | |
| class | ndScene |
| class | ndContactArray |
| class | ndBodyKinematic |
| class | ndContactSolver |
| class | ndShapeInstance |
| class | ndConvexCastNotify |
| class | ndShapeConvexPolygon |
| class | ndBodyPlayerCapsuleContactSolver |
Additional Inherited Members | |
| Static Public Member Functions inherited from ndContainersFreeListAlloc< ndConstraint > | |
| static void | FlushFreeList (ndInt32 size) |
| Static Public Member Functions inherited from ndFreeListAlloc | |
| static D_CORE_API void | Flush () |
| static D_CORE_API void | Flush (ndInt32 size) |
| Public Attributes inherited from ndConstraint | |
| ndInt32 | m_rowCount |
| ndInt32 | m_rowStart |
| ndUnsigned8 | m_active |
| ndUnsigned8 | m_fence0 |
| ndUnsigned8 | m_fence1 |
| ndUnsigned8 | m_resting |
| ndUnsigned8 | m_isInSkeletonLoop |


!(http://img.youtube.com/vi/r2aURZbVR38/0.jpg)
Lemur is one of the most powerful and flexible MIDI controllers out there. When it comes to setting up Lemur though, things are a bit more involved than the usual USB MIDI controller. The following article will take you step-by-step on setting up Lemur and how to configure Traktor for use with a custom MIDI map. The video above shows all of the steps from start to finish. Though the focus is on Mac, many of the general principles will also apply to PC.
Getting the Software:
The Lemur app is available from the Apple App Store. Once purchased, head over to Liine.net and download the additional software that’s needed. The software includes two applications: the Lemur Editor which loads and edits templates, and the Lemur Daemon which works as a bridge between the audio software and the Lemur app. You will need to register with Liine before downloading these. It’s also worth taking a look at the premium templates while at the site. There are hundreds of user templates created by the Lemur community and the premium ones are some of the best.
Tech Overview:
It’s helpful to have a bit of an understanding of how the different parts of Lemur work together. A Lemur setup includes four main components. The first is the Lemur iPad app. The next two are the Lemur Editor and Lemur Daemon that you downloaded from the site. Last is the ad hoc network or hardwired MIDI connection. An ad hoc network is a computer to computer wireless network that’s created on the host computer. In a Lemur setup, this ad hoc network consists of two devices: the iPad with the Lemur app on it and the computer running the Lemur Editor and audio software to be controlled.
Steps for setting up Lemur on a Mac:
- First, make sure the Lemur Daemon is running. When on, the Daemon shows up as a small iconin the upper right of the desktop. You can set the Daemon to always launch at startup by clicking on the icon and clicking “Setup Daemon Preferences” from the dropdown menu.
- Next it’s time to create the Ad Hoc network:
- Click on the WiFi symbol in the upper right of the desktop and select “create network” from the dropdown menu.
- After giving the network a new name or leaving it at default, hit the create button.
- Now on your iPad go into the “WiFi” area in the settings. You should see the name of theÂ network you just created. Click on it and verify that the iPad connects to it.
Your iPad and host computer are now connected to eachother on their own ad hoc network.
- Now you will connect the Lemur Editor on the host computer to the Lemur app on the iPad.
- Run the Lemur App on your iPad.
- Now start the Lemur Editor on the computer.
- Once the Editor opens, press the small box with an arrow in the upper right corner. Your iPad and its IP address should show up in the “connection” box that pops up. It may take a minute or two for your iPad to appear.
- Double click on your iPad name in the “connection” box. The arrow button in the upper right of the Lemur Editor should turn into a green square indicating a connection with the iPad.
- Finally it’s time to load a Lemur template into the iPad app. To do this, first open a template in the editor by double clicking on the .jzml file. Then click the arrow button in the Editor and then double click your iPad in the “connection” box.
Your Lemur template should now be loaded onto the iPad and ready to control.
Extra Tips:
-
It’s possible to upload a template from your iPad to the Lemur Editor on the computer. To upload a template, first click the arrow button in the Editor. Now, instead of double clicking on your iPad name in the “connection” box, highlight your iPad and press the download button at the bottom of the box. Your template will now upload to the Editor.
-
The Lemur Editor can also mirror the slider movements and button presses you make on your iPad. This feature helps when modifying or creating templates from scratch. To turn on mirroring, click the small box with two arrows in the upper right corner of the Editor. Once activated, the arrows in the box will turn green.
Using Lemur with Audio Software:
Now that you can load templates between the Lemur Editor and Lemur iPad app, let’s take a look at how to setup an audio program like Traktor to use Lemurs MIDI ports.
Traktor Preference Settings:
-
With Traktor running, open up the “Preferences” from the dropdown menu and click on “Controller Manager” located at the bottom of the lefthand side.
-
In the “Device Setup” area at the top, click on the “Load” button. Then from the dropdown menu select “Import TSI” and from the next menu click on “Import Other”.
-
Now locate the .TSI file you want to load into Traktor.
-
Finally, make sure that the “In Port” and “Out Port” in the “Device Setup” area are set to the correct Lemur MIDI ports. These port may be different depending on the Lemur template, but a good place to start is with “Daemon In 0″ and “Daemon Out 0″.
Your Lemur template should now be MIDI mapped to Traktor.
Traktor is just one of the many examples of music software that that Lemur can control. In fact, most other programs are even easier to set up as they won’t need any sort of .tsi file loaded in. For these, setting up Lemur is pretty much the same as setting up a standard USB MIDI controller.


LENT 3 SATURDAY
Alternative Readings for the 3rd Week
Entrance Antiphon
Bless the Lord, O my soul, and never forget all his benefits; it is he who forgives all your sins.
Collect
Rejoicing in this annual celebration of our Lenten observance, we pray, O Lord, that, with our hearts set on the paschal mysteries, we may be gladdened by their full effects. Through our Lord. . .
FIRST READING Hosea 6:1-6
“I desire mercy and not sacrifice.”
A reading from the Book of the Prophet Hosea
"Come, let us return to the LORD; for he has
torn, that he may heal us; he has stricken, and he will bind us up. After two days
he will revive us; on the third day he will raise us up, that we may live
before him. Let us know, let us press on to know the LORD; his going forth is
sure as the dawn; he will come to us as the showers, as the spring rains that
water the earth." What shall I do with you, O Ephraim? What shall I do
with you, O Judah? Your love is like a morning cloud, like the dew that goes
early away. Therefore I have hewn them by the prophets, I have slain them by
the words of my mouth, and my judgment goes forth as the light. For I desire
steadfast love and not sacrifice, the knowledge of God, rather than burnt
offerings.
The word of the Lord
RESPONSORIAL PSALM Psalm 51:3-4.18-19.20-21ab (See Hosea 6:6)
R. I desire mercy, and not sacrifice.
Have mercy on me, O God, according to your merciful
love; according to your great compassion, blot out my transgressions. Wash me
completely from my iniquity, and cleanse me from my sin.
R. I desire mercy, and not sacrifice.
For in sacrifice you take no delight, burnt
offering from me would not please you. My sacrifice to God, a broken spirit: a
broken and humbled heart, O God, you will not spurn.
R. I desire mercy, and not sacrifice.
In your good pleasure, show favour to Sion; rebuild
the walls of
R. I desire mercy, and not sacrifice.
VERSE BEFORE THE GOSPEL See Psalm 95:7d.8a
R. Glory and praise to you, O Christ.
Today, harden not your hearts, but listen to the voice of the Lord.
R. Glory and praise to you, O Christ.
GOSPEL Luke 18:9-14
The tax collector went down to his house justified rather than the Pharisee.
A reading from the holy Gospel according to Luke
At that time: Jesus told this parable to some who trusted in themselves that they were righteous and despised others: "Two men went up into the temple to pray, one a Pharisee and the other a tax collector. The Pharisee stood and prayed thus with himself, 'God, I thank you that I am not like other men, extortioners, unjust, adulterers, or even like this tax collector. I fast twice a week, I give tithes of all that I get.' But the tax collector, standing far off, would not even lift up his eyes to heaven, but beat his breast, saying, 'God, be merciful to me a sinner!' I tell you, this man went down to his house justified rather than the other; for every one who exalts himself will be humbled, but he who humbles himself will be exalted."
The Gospel of the Lord
Prayer over the Offerings
O God, by whose grace it comes to pass that we may approach your mysteries with minds made pure, grant, we pray, that in reverently handing them on, we may offer you fitting homage. Through Christ our Lord.
Preface of Lent,
Communion Antiphon
The tax collector stood at a distance, beating his breast and saying: O God, be merciful to me, a sinner.
Prayer after Communion
May we truly revere, O merciful God, these holy gifts by which you ceaselessly nourish us, and may we always partake of them with abundant faith in our heart. Through Christ our Lord.
Prayer over the People
Hold out to your faithful people, Lord, the right hand of heavenly assistance, that they may seek you with all their heart and merit the granting of what they ask. Through Christ our Lord.


I have a solar system comprised of solar panels and a wind turbine. I want to monitor the health and status of the system remotely via wifi. Will this system (and what components) work for my application?
Archived Forum |
|
Monitor of Solar systemSubmitted by jurgen on Sat, 29/08/2015 - 02:21I have a solar system comprised of solar panels and a wind turbine. I want to monitor the health and status of the system remotely via wifi. Will this system (and what components) work for my application?
» |
Re: Monitor of Solar system
The short answer is most likely "Yes", but can you tell us more about what you have?
Is it a d.c. or 1- or 3-phase a.c. system, what voltage? What do you want by way of 'health and status'?, e.g. do you want to transmit some data from your inverter(s), and how is that data available to you?
If you only have two single-phase a.c. sources that you want to measure, an emonPi with a WiFi dongle will do what you want. Out of the box, that will give you voltage (with an AC adapter), current, power and energy, and give you the data on local web pages; it will not accept external data such as a serial or optical connection from your inverter. To do that, you would need to add external connections and possibly interfaces, and modify the software.
Re: Monitor of Solar system
Thanks for the reply. I have several solar panels and a wind turbine combined to charge a 12 v battery bank. An inverter is connected to the battery bank to supply 110 VAC (single phase) to the house. The electronics and batteries are located about 80 feet from the house. Currently i have a single monitor that i can measure net amps (in/out) of the batteries, current voltage, % of battery charge, etc. located with the batteries. I want to be able to monitor all this from my house and possibly via the internet (for when i am not at my location).
Re: Monitor of Solar system
Does your present monitor have a data output of any kind, or are you intending to replace it?
Re: Monitor of Solar system
It is a xantronix monitor. No data ports. I can replace it.
Re: Monitor of Solar system
That is not what I was hoping to hear.
I think the easy solution might be to find a replacement monitor that does have a data output, and the data must be in a published format, because you will most likely need to write some software to change the format.
A somewhat harder way, but one which you will have complete control over, will be to design and build your own monitor using the emonPi as an example. The emonPi is in essence a custom design of 3-input Arduino and a Raspberry Pi in one box. You will need an Arduino with at least at least 6 analogue inputs, as you'll need to add a front end to give you a.c. current and voltage inputs for the inverter output (unless you do that in the house), and d.c. inputs for solar output, wind output, nett battery current and voltage, and presumably you'll need digital inputs for a few temperatures (ambient, battery) too. That should give you enough information to implement a charge monitor in software. The Arduino will communicate serially with the Raspberry Pi.
The Raspberry Pi will give you a Web server that will run emonCMS, getting its data via emonHub, and by adding a WiFi dongle to get onto your LAN, it will be accessible from anywhere.
So to answer the original question, we cannot give you a solution for all your needs 'off-the-shelf'. But all the things you need have been done here and published, your task is to assemble all the parts as an integrated system.


Discover & share your interests
Copyright © 2014 TFEU Inc. Privacy Policy and Terms of Use
Images sourced from Flickr and GovTrack


The Bachelor of Arts - Bachelor of Legislative Law (BA LLB) course is an integrated law degree that the law aspirants can pursue right after qualifying their Class 12th examinations. The law degree is an integration of Arts and Law subjects and is of five-years duration. Therefore, as part of the BA LLB course, the candidates study subjects including Economics, History, Political Science, Sociology along with law subjects like Civil Law, Criminal Law, Labour Law, Tax Law, Administrative Law, Corporate Law, Patent Law etc. The course-curriculum of BA LLB degree is such that law, as well as, the arts subjects, are included in each semester. Moreover, candidates are taught about law case studies, moot courts, law internships, seminars and interactions with retired judges from High courts and the Supreme Court of India.
Popular Law Specializations
Company Law ,Business Law ,Corporate Law ,Criminal Law
BA LLB Eligibility Criteria
Candidates seeking admission to BA LLB course need to meet the eligibility criteria as mentioned by the law schools and universities in India including, academic qualification, minimum qualifying marks and age limit. if they have completed their 10+2 from a recognised board. Apart from this, most popular law colleges also fix a minimum marks requirement in order to be eligible to apply for the BA LLB course offered by them. By means of this criteria, candidates belonging to General/ OBC/ Specially abled person categories need to secure at least 45% marks at their 10+2 level in order to pursue a BA LLB course and the percentage fixed for SC/ ST category is 40%. The Bar Council of India (BCI) states no minimum or maximum age limit criteria is required for admissions to BA LLB course or five-year integrated law courses.
BA LLB Skillset
BA LLB course requires aspirants to be hardworking and extremely thorough in their subject. Some key skills that aspirants should possess in order to perform well in BA LLB course are listed below: Fluency , Clarity of speech , Ability to work long hours , Objectivity , Good judgement of situation/people , Persuasiveness , Hard working , Confidence , Interest in Research , Integrity , Intellect ,Ability to assimilate and analyse facts , Convincing power , Good presentation skills
Top BA LLB Entrance Exams
For admissions to BA LLB course, aspirants need to appear for the law entrance exam accepted by the law college or university. Listed below are the popular law entrance exams in India for BA LLB course:
BA LLB Entrance Exams
Common-Law Aptitude Test (CLAT) LSAT India, MH CET Law ,ILSAT, TS LAWCET ,AP LAWCET BA LLB Subjects and Syllabus In the five-years duration of BA LLB course, law students get to study the following subjects along with internships, projects, moot courts, and much more:
Subjects for BA LLB course
Administrative Law , Comparative Law , Economics , Advocacy Skills , Constitutional Law , Election Law , Alternative Dispute Resolution , Corporate Law , Environmental Law , Banking Law and Insurance Law , Criminology , Family Law , Business Law ,Drafting and Pleading , Forensic Sciences , Code of Civil Procedure , Dissertation , Language - French/ German , Code of Criminal Procedure , English and Legal Language , Healthcare Law , Human Rights Law , International Trade Law , Labour Law , History (Indian and World History) , ,Interpretation of Statutes ,Land Laws ,Indirect Taxes ,Investment and Competition Law ,Law of Contract Intellectual Property Rights , Jurisprudence , Law of Crimes , Law of Evidence , Law and Technology , Political Science , Law of International Organisations , Legal Ethics and Court Craft , Private International Law , Law of Torts and Consumer Protection , Legal Writing and Research , Public International Law , Law, Poverty and Development , Legal Method , Property Law , Security Law , Socio-Economic Offences , Techniques of Communication, Client Interviewing and Counselling , Sociology , Tax Law , Women and Law After completing an integrated BA LLB course, candidates are offered many job opportunities. Some popular job profiles that candidates can pursue after securing a BA LLB degree are as mentioned below: Job Profile : Job Description, Lawyer : In this job profile, one needs to advise and represent clients in civil as well as criminal cases. Lawyers present cases in the court of law and take part in all proceedings and hearings. Solicitor : In such a job profile an individual usually specialises in a specific area of law like tax, litigation, family or property. Solicitors offer legal advice to private as well as commercial clients. Advocate : In such a job profile one needs to do a lot of research work to gather factual data as well as physical evidence to support their claim. Apart from this, other responsibilities allocated to advocates include scrutinising and drafting contracts. Legal Advisor : Candidates opting to work in such a job profile are also lawyers who specialise in a specific field of law. Legal advisors are usually hired by governments as well as large organisations/ companies. The main task of a legal advisor is to protect their clients from any legal implication or consequence. Teacher or Lecturer : After completing an LLB degree candidates can also teach law at the college or university level.
BA LLB Top Recruiters
The top legal firms that are known to hire law graduates are listed below: Amarchand & Mangaldas & Suresh A Shroff & Co. ,AZB & Partners ,Khaitan & CO ,J Sagar Associates ,Luthra & Luthra Law Offices ,Trilegal ,S&R Associates ,Economic Laws Practice ,Desai & Diwanji ,Talwar Thakore & Associates


We just updated our privacy policy here to better service our customers. We recommend reviewing the changes.


Methods
-
dirname(filename) → {string}
-
Extracts the directory name from a file name.
Parameters:
Name Type Description filename
string File name
- Source:
Returns:
Directory name
- Type
- string
-
escapestr(s) → {string}
-
Escaoes a string to be used inside of a single or double quote enclosed JavaScript string.
Parameters:
Name Type Description s
string String to escape
- Source:
Returns:
Escaped string
- Type
- string
-
include(filename, absolute)
-
Includes another source file.
Parameters:
Name Type Description filename
string File to include. May be a glob expression on node.js.
absolute
boolean Whether the path is absolute, defaults to
false
for a relative path- Source:
-
indent(str, indent) → {string}
-
Indents a block of text.
Parameters:
Name Type Description str
string Text to indent
indent
string | number Whitespace text to use for indentation or the number of whitespaces to use
- Source:
Returns:
Indented text
- Type
- string
-
write(s)
-
Writes some contents to the document (no indentation).
Parameters:
Name Type Description s
* Contents to write
- Source:
-
writeln(s)
-
Writes some contents to the document, followed by a new line.
Parameters:
Name Type Description s
* Contents to write
- Source:


Pie with 2 slices with one MUCH larger than all the others, but minwidth keeps it from not showing the small ones.
That's all Folks!


Matching Game
MATCH ALL CARDS TO WIN THE GAME !
HINT :
Try to finish with less than 15 moves to get 3 stars!
READY
Matching Game
TIME:
0.00
0
Moves
Restart
Winner winner chicken dinner!
x
x
x
Cancel
Replay


I've had enough of not being able to "fix" local phpfiXa data as I get various spikes and the removespike stuff just doesn't work. I read that the editRealtime/editDaily visualisations are disabled and then reading the code I notice it only actually works on mysql.
My data volumes really don't need magic optimised storage and I have enough mysql tuning experience (call it suffering) from my working life to be happy playing there.
Is there anyway to move my data from the existing php* feeds into MySQL ? I haven't yet found a description of the MySQL tables structure and while I am happy to go play I don't want to duplicate work if it's already done.
Re: Move local php data to mysql?
Forget that, looks like I can't use MySQL for any of the calculated feeds anyway.
Re: Move local php data to mysql?
What kind of feeds are you trying to correct, is this on an emonpi? running the standard low-write configuration? What kind of errors do you get when you run the removespike script?
Re: Move local php data to mysql?
This is on my local Linux install.
I think I've now worked this out. Luser error - I may have forgotten to sudo and the permission denied scrolled off screen immediately. Perhaps one change would be to exit immediately after a permission failure on the file?
Sorry...


Murray faces 'Baby Fed' instead of Federer at ATP Cup
MELBOURNE (Reuters) - Former world number one Andy Murray is in line to play Grigor Dimitrov in the opening round of the inaugural ATP Cup, with Bulgaria qualifying among the final six teams in the nation-based tournament.
Briton Murray, on the comeback trail after hip surgery, was initially set to face Roger Federer in a blockbuster Group C clash in Sydney but the 20-times Grand Slam champion pulled out of the Jan. 3-12 tournament, making Switzerland ineligible.
Bulgaria have replaced Switzerland in the group, meaning Murray instead faces a prospective match with Dimitrov, dubbed “Baby Fed” for his similar playing style to the Swiss master.
Chile, Poland, Uruguay, Moldova and Norway are the other five teams that qualified for the 24-nation field at the close of the second and final deadline.
The six group winners and the two best second-placed finishers across the groups reach the ATP Cup Finals in Sydney.
Each tie comprises two singles and one doubles match.
World number one Rafa Nadal kicks off his tournament with Spain in Perth against Group B rivals Japan, Georgia and Uruguay, the tournament draw confirmed on Thursday.
Serbia, led by world number two Novak Djokovic, play Chile, France and South Africa in Group A in Brisbane.
Russian young gun Daniil Medvedev, beaten in the U.S. Open final by Nadal, will highlight Group D for Russia against the United States, Italy and Norway.
Group F has Germany, Greece, Canada and Australia playing off in Brisbane and boasts a mouthwatering array of young talent.
German world number six Alexander Zverev is likely to feature in the singles along with Greek tyro Stefanos Tsitsipas and tempestuous Australian Nick Kyrgios.
ATP Cup
Group A - Serbia, France, South Africa, Chile (Brisbane)
Group B - Spain, Japan, Georgia, Uruguay (Perth)
Group C – Belgium, Great Britain, Bulgaria, Moldova (Sydney)
Group D - Russia, Italy, United States, Norway (Perth)
Group E - Austria, Croatia, Argentina, Poland (Sydney)
Group F - Germany, Greece, Canada, Australia (Brisbane)


Click on the orange square, keep the mouse button down and drag it to the blue square,
release the mouse over the blue square.
REGIONS ARE NOT ENABLED
between the squares between the squares between the squares between the squares between the squares
between the squares between the squares between the squares between the squares between the squares
between the squares between the squares between the squares
after the squares after the squares after the squares after the squares after the squares
after the squares after the squares after the squares after the squares after the squares
after the squares after the squares


public abstract class AbstractBulkByScrollRequestBuilder<Request extends AbstractBulkByScrollRequest<Request>,Self extends AbstractBulkByScrollRequestBuilder<Request,Self>> extends ActionRequestBuilder<Request,BulkByScrollResponse,Self>
action, client, request
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractBulkByScrollRequestBuilder(ElasticsearchClient client,
Action<Request,BulkByScrollResponse,Self> action,
SearchRequestBuilder source,
Request request) |
| 限定符和类型 | 方法和说明 |
|---|---|
Self |
abortOnVersionConflict(boolean abortOnVersionConflict)
Should we version conflicts cause the action to abort?
|
Self |
filter(QueryBuilder filter)
Set the query that will filter the source.
|
Self |
refresh(boolean refresh)
Call refresh on the indexes we've written to after the request ends?
|
protected abstract Self |
self() |
Self |
setMaxRetries(int maxRetries)
Total number of retries attempted for rejections.
|
Self |
setRequestsPerSecond(float requestsPerSecond)
Set the throttle for this request in sub-requests per second.
|
Self |
setRetryBackoffInitialTime(TimeValue retryBackoffInitialTime)
Initial delay after a rejection before retrying a bulk request.
|
Self |
setShouldStoreResult(boolean shouldStoreResult)
Should this task store its result after it has finished?
|
Self |
setSlices(int slices)
The number of slices this task should be divided into.
|
Self |
size(int size)
The maximum number of documents to attempt.
|
SearchRequestBuilder |
source()
The search used to find documents to process.
|
Self |
source(java.lang.String... indices)
Set the source indices.
|
Self |
timeout(TimeValue timeout)
Timeout to wait for the shards on to be available for each bulk request.
|
Self |
waitForActiveShards(ActiveShardCount activeShardCount)
The number of shard copies that must be active before proceeding with the write.
|
protected AbstractBulkByScrollRequestBuilder(ElasticsearchClient client, Action<Request,BulkByScrollResponse,Self> action, SearchRequestBuilder source, Request request)
protected abstract Self self()
public SearchRequestBuilder source()
public Self source(java.lang.String... indices)
public Self filter(QueryBuilder filter)
public Self size(int size)
public Self abortOnVersionConflict(boolean abortOnVersionConflict)
public Self refresh(boolean refresh)
public Self timeout(TimeValue timeout)
public Self waitForActiveShards(ActiveShardCount activeShardCount)
ReplicationRequest.waitForActiveShards(ActiveShardCount)
for details.public Self setRetryBackoffInitialTime(TimeValue retryBackoffInitialTime)
public Self setMaxRetries(int maxRetries)
public Self setRequestsPerSecond(float requestsPerSecond)
Float.POSITIVE_INFINITY
means set no throttle and that is the
default. Throttling is done between batches, as we start the next scroll requests. That way we can increase the scroll's timeout to
make sure that it contains any time that we might wait.public Self setShouldStoreResult(boolean shouldStoreResult)
public Self setSlices(int slices)


Stream Layer: Filtering
Stream Service Url. Click button to add/remove layer
Add Stream Layer
Draw extent to filter messages by a bounding box
Enter Where Clause


After realizing that Googlebot was not actually indexing our single page app, we decided to try to whip up a very quick server side solution:
- use grunt-html-snapshot to generate static pages that are put in a
/static/snapshots/
folder in django - nginx detects for a crawler,
- if detected, maintain the same file path, but preprend with the
/static/snapshots/
route- i.e. example.com/about -> example.com/static/snapshots/about
This was a bad solution for a variety of reasons:
- It’s not dynamic. If the crawler hits a user profile or a dynamic page, we would not serve up the correct content.
- Google doesn’t like it when you serve the crawler something different from your sites real content.
- We were still sending a soft 404.
- We would have to generate new snapshots on each deploy and add/substract/edit new routes anytime something changed.
- Even in their official docs, Google doesn’t sound all that thrilled about using redirects for SEO.
To recap, attempts at SEO:
1. Relying on Googelbot executing JS
2. Using a 302 redirect.


{% extends "global/Page.html" %} {% load otree static %} {% block title %} Results {% endblock %} {% block content %}
In the random round chosen for payment in the division assignment task (where $10 was divided between you and and your counterpart) you chose to take ${{ amountstolen }}, meaning that you were {{ beginning_innocence_tf }}. Using this information, you were assigned an initial crime level of {{ beginning_crime }} and given {{ beginning_innocence }} evidence of innocence with {{ beginning_guilt }} evidence of guilt. This led to the following outcomes:
{% if not ending_trial_status %}You were not taken to trial.
{% if not ending_guilt %}Hence, you are not guilty and have received no monetary punishment.
{% endif %} {% if ending_guilt %}You were found guilty of a {{ crimelevel }} crime.
You have been penalized ${{ punishment }}.
The guilty verdict was a result of a plea bargain.
{% endif %} {% endif %} {% if ending_trial_status %}You were taken to trial.
{% if not ending_guilt %}However, the jury returned a verdict of "Not Guilty".
Hence, you are not guilty and have received no monetary punishment.
{% endif %} {% if ending_guilt %}The jury returned a verdict of "Guilty".
You were found guilty of a {{ crimelevel }} crime.
You have been penalized ${{ punishment }}.
{% endif %} {% endif %} {% if trialornot == 'NONE' and ending_trial_status and not ending_trial_status %}The prosecutor had no evidence of a crime.
Therefore, you were not taken to trial.
Hence, you were not found guilty nor were you penalized.
{% endif %} {% next_button %} {% endblock %}


Pricing Counterparty Risk
- Bilateral nature of credit exposure makes counterparty risk difficult to quantify
- Credit value adjustment (CVA) - measures counterparty risk via a combination of:
- The current risk-free value of the transaction(s)
- A term representing the counterparty risk of the positions is subtracted out
- CVA (assuming no wrong-way risk) ≈ Loss given default × Sum of (Discount factors × Expected exposure × Default probability)
- CVA spread = CVA(t,T)/CDSpremium(t,T) = XCDS × EPE
Bilateral Counterparty Risk
Bilateral CVAs are calculated under the assumption that both parties may default


| 1 | package fr.sii.ogham.testing.assertion.internal; | |
| 2 | ||
| 3 | import java.util.HashSet; | |
| 4 | import java.util.List; | |
| 5 | import java.util.Set; | |
| 6 | ||
| 7 | import org.apache.commons.lang3.reflect.FieldUtils; | |
| 8 | ||
| 9 | import fr.sii.ogham.core.resource.resolver.ClassPathResolver; | |
| 10 | import fr.sii.ogham.core.resource.resolver.FileResolver; | |
| 11 | import fr.sii.ogham.core.resource.resolver.FirstSupportingResourceResolver; | |
| 12 | import fr.sii.ogham.core.resource.resolver.RelativeResolver; | |
| 13 | import fr.sii.ogham.core.resource.resolver.ResourceResolver; | |
| 14 | import fr.sii.ogham.testing.util.HasParent; | |
| 15 | ||
| 16 | /** | |
| 17 | * Make assertions on resource resolution. | |
| 18 | * | |
| 19 | * | |
| 20 | * <pre> | |
| 21 | * {@code | |
| 22 | * classpath() | |
| 23 | * .pathPrefix(is("prefix/") | |
| 24 | * } | |
| 25 | * </pre> | |
| 26 | * | |
| 27 | * @param <P> | |
| 28 | * the parent type | |
| 29 | */ | |
| 30 | public class ResourceResolverAssertions<P> extends HasParent<P> { | |
| 31 | private final Set<ResourceResolver> resolvers; | |
| 32 | ||
| 33 | public ResourceResolverAssertions(P parent, Set<ResourceResolver> resourceResolvers) { | |
| 34 | super(parent); | |
| 35 | this.resolvers = resourceResolvers; | |
| 36 | } | |
| 37 | ||
| 38 | /** | |
| 39 | * Make assertions on classpath resolution. | |
| 40 | * | |
| 41 | * <pre> | |
| 42 | * {@code | |
| 43 | * .pathPrefix(is("/custom/")) | |
| 44 | * .pathSuffix(is(".html")) | |
| 45 | * } | |
| 46 | * </pre> | |
| 47 | * | |
| 48 | * @return the builder for fluent chaining | |
| 49 | */ | |
| 50 | public RelativeResolutionAssertions<ResourceResolverAssertions<P>> classpath() { | |
| 51 |
2
1. classpath : replaced return value with null for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::classpath → NO_COVERAGE 2. classpath : replaced return value with null for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::classpath → KILLED |
return new RelativeResolutionAssertions<>(this, "classpath", getRelativeResolversFor(ClassPathResolver.class)); |
| 52 | } | |
| 53 | ||
| 54 | /** | |
| 55 | * Make assertions on file resolution. | |
| 56 | * | |
| 57 | * <pre> | |
| 58 | * {@code | |
| 59 | * .pathPrefix(is("/custom/")) | |
| 60 | * .pathSuffix(is(".html")) | |
| 61 | * } | |
| 62 | * </pre> | |
| 63 | * | |
| 64 | * @return the builder for fluent chaining | |
| 65 | */ | |
| 66 | public RelativeResolutionAssertions<ResourceResolverAssertions<P>> file() { | |
| 67 |
2
1. file : replaced return value with null for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::file → NO_COVERAGE 2. file : replaced return value with null for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::file → KILLED |
return new RelativeResolutionAssertions<>(this, "file", getRelativeResolversFor(FileResolver.class)); |
| 68 | } | |
| 69 | ||
| 70 | private <T> Set<RelativeResolver> getRelativeResolversFor(Class<T> resolverClass) { | |
| 71 | Set<RelativeResolver> found = new HashSet<>(); | |
| 72 | for (ResourceResolver resolver : resolvers) { | |
| 73 | Set<RelativeResolver> relativeResolvers = findResolvers(resolver, RelativeResolver.class); | |
| 74 | for (RelativeResolver relative : relativeResolvers) { | |
| 75 |
2
1. getRelativeResolversFor : negated conditional → NO_COVERAGE 2. getRelativeResolversFor : negated conditional → KILLED |
if (resolverClass.isAssignableFrom(relative.getActualResourceResolver().getClass())) { |
| 76 | found.add(relative); | |
| 77 | } | |
| 78 | } | |
| 79 | } | |
| 80 |
2
1. getRelativeResolversFor : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::getRelativeResolversFor → NO_COVERAGE 2. getRelativeResolversFor : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::getRelativeResolversFor → SURVIVED |
return found; |
| 81 | } | |
| 82 | ||
| 83 | @SuppressWarnings("unchecked") | |
| 84 | private static <T> Set<T> findResolvers(ResourceResolver resolver, Class<T> resolverClass) { | |
| 85 | Set<T> found = new HashSet<>(); | |
| 86 |
2
1. findResolvers : negated conditional → NO_COVERAGE 2. findResolvers : negated conditional → KILLED |
if (resolverClass.isAssignableFrom(resolver.getClass())) { |
| 87 | found.add((T) resolver); | |
| 88 | } | |
| 89 |
2
1. findResolvers : negated conditional → NO_COVERAGE 2. findResolvers : negated conditional → SURVIVED |
if (resolver instanceof FirstSupportingResourceResolver) { |
| 90 | found.addAll(findResolvers((FirstSupportingResourceResolver) resolver, resolverClass)); | |
| 91 | } | |
| 92 |
2
1. findResolvers : negated conditional → NO_COVERAGE 2. findResolvers : negated conditional → KILLED |
if (resolver instanceof RelativeResolver) { |
| 93 | found.addAll(findResolvers((RelativeResolver) resolver, resolverClass)); | |
| 94 | } | |
| 95 |
2
1. findResolvers : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::findResolvers → SURVIVED 2. findResolvers : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::findResolvers → NO_COVERAGE |
return found; |
| 96 | } | |
| 97 | ||
| 98 | @SuppressWarnings("unchecked") | |
| 99 | private static <T> Set<T> findResolvers(FirstSupportingResourceResolver resolver, Class<T> resolverClass) { | |
| 100 | try { | |
| 101 | Set<T> found = new HashSet<>(); | |
| 102 | List<ResourceResolver> subresolvers = (List<ResourceResolver>) FieldUtils.readField(resolver, "resolvers", true); | |
| 103 | for (ResourceResolver r : subresolvers) { | |
| 104 | found.addAll(findResolvers(r, resolverClass)); | |
| 105 | } | |
| 106 |
2
1. findResolvers : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::findResolvers → NO_COVERAGE 2. findResolvers : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::findResolvers → SURVIVED |
return found; |
| 107 | } catch (IllegalAccessException e) { | |
| 108 | throw new IllegalStateException("Failed to get 'resolvers' field of FirstSupportingResourceResolver", e); | |
| 109 | } | |
| 110 | } | |
| 111 | ||
| 112 | @SuppressWarnings("unchecked") | |
| 113 | private static <T> Set<T> findResolvers(RelativeResolver resolver, Class<T> resolverClass) { | |
| 114 | try { | |
| 115 | Set<T> found = new HashSet<>(); | |
| 116 |
2
1. findResolvers : negated conditional → SURVIVED 2. findResolvers : negated conditional → NO_COVERAGE |
if (resolverClass.isAssignableFrom(resolver.getClass())) { |
| 117 | found.add((T) resolver); | |
| 118 | } | |
| 119 | ResourceResolver delegate = (ResourceResolver) FieldUtils.readField(resolver, "delegate", true); | |
| 120 |
2
1. findResolvers : negated conditional → NO_COVERAGE 2. findResolvers : negated conditional → KILLED |
if (resolverClass.isAssignableFrom(resolver.getActualResourceResolver().getClass())) { |
| 121 | found.add((T) delegate); | |
| 122 | } | |
| 123 |
2
1. findResolvers : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::findResolvers → NO_COVERAGE 2. findResolvers : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/internal/ResourceResolverAssertions::findResolvers → SURVIVED |
return found; |
| 124 | } catch (IllegalAccessException e) { | |
| 125 | throw new IllegalStateException("Failed to get 'delegate' field of RelativeResolver", e); | |
| 126 | } | |
| 127 | } | |
| 128 | ||
| 129 | } | |
Mutations | ||
| 51 |
1.1 2.2 |
|
| 67 |
1.1 2.2 |
|
| 75 |
1.1 2.2 |
|
| 80 |
1.1 2.2 |
|
| 86 |
1.1 2.2 |
|
| 89 |
1.1 2.2 |
|
| 92 |
1.1 2.2 |
|
| 95 |
1.1 2.2 |
|
| 106 |
1.1 2.2 |
|
| 116 |
1.1 2.2 |
|
| 120 |
1.1 2.2 |
|
| 123 |
1.1 2.2 |


Single Sign-On Federated Identity (a.k.a. SSOFI) is an identify server for the purpose of allowing you to log into applications and to maintain your password. SSOFI is open source software and the exact policy is up to the organization that makes the SSOFI server available to the public.
The SSOFI server hosted at circleweaver.com is provided by Circle Weaver Tech LLC, which is committed to respecting your privacy and protecting your personal information.
You can access our full Privacy Policy below to help you to understand better how we use your personal information. In it, we explain in more detail the types of personal information we collect, how we collect it, what we may use it for and who we may share it with.
Within the Privacy Policy you will find some specific examples of why and how we use your personal information.
Without prejudice to your rights under applicable laws, the above and the Privacy Policy are not contractual and do not form part of your contract with us.
SSOFI is an identity server, which means that its purpose is to prove who you are to an application that relies on it. You log into it using an email address and a password which you set up. You can also provide a full name for user-friendly screen labeling. Once you log in, the SSOFI server will use a cookie to remember who you are the next time you access it. As you access applications that rely on SSOFI, the application will interact with SSOFI and in doing so be given your email address and name in a reliable manner. This is given only to applications that you access, and only when you are logged in.
Note: SSOFI is a completely different server from the application you are trying to log into. The application that uses SSOFI may have a different privacy policy than this one. This privacy policy is purely for the SSOFI identity server which allows you to log in to authenticate yourself to other applications.
Of course, the short version doesn't tell you everything, so please read on for more details!
Any personal information processed by SSOFI in connection with this Privacy Policy is controlled by Circle Weaver Tech LLC, which is considered the "data controller" of your personal information under applicable data protection law.
Personal information means details which identify you or could be used to identify you, such as your name and your email address.
All participants are required to provide an email address as a globally unique ID for who you are. An email is sent to that email address first to verify that you own the email address. Later, you can request an email be sent in order to set or change your password. You email address is passed to the relying application in order to identify you from all other people.
If you wish to use SSOFI without your personal email address being seen by others, you are encouraged to obtain and use a email address from a free or low cost supplier, like GMail or competitor to use as a unique ID and as a way to receive communications from SSOFI. If you are not able to find a suitable vendor for this, an obfuscated email address can be provided for a reasonable charge not to exceed $15/month by making a written request to Circle Weaver Tech LLC.
Each user provides a full name which is used as a label to be used on screen to indication actions you have taken within the relying applications.
If you don't want to use your real name, you are allowed to enter an alias. You can set your name to be any value that you wish, and that will be the name that others in the system will identify you as.
Cookies are a technology feature of a browser that allows you to be identified across multiple requests. As you log in, a cookie is set. That value indicates that the request comes from the same browser that you used to log in, and so the request is identified as coming from you.
Cookies are also given to the browser to save the login id that you have used in the past, simply as a convenience to make it easier to log in the next time you visit.
You may clear your cookies at any time, but you will lose your current logged in session, and you will not be allowed access any new relying applications until you log in again. Disabling cookies will defeat the ability of the identity server to function.
SSOFI does not request any sensitive personal information, such as social security numbers, genetic data, health information, or religious information.
If you're a child under the age of 13, you may not have an account on SSOFI. SSOFI does not knowingly collect information from or direct any of our content specifically to children under 13. If we learn or have reason to suspect that you are a user who is under the age of 13, we will unfortunately have to close your account. Other countries may have different minimum age limits, and if you are below the minimum age for providing consent for data collection in your country, you may not use Circle Weaver without obtaining your parents' or legal guardians' consent.
We do share certain aggregated, non-personally identifying information with others about how our users, collectively, use SSOFI. For example, we may compile statistics on the patterns of login to be used to estimate when a server might have to be enhanced. However, we do not sell this information to advertisers or marketers.
Circle Weaver Tech LLC may disclose personally-identifying information or other information we collect about you to law enforcement in response to a valid subpoena, court order, warrant, or similar government order, or when we believe in good faith that disclosure is reasonably necessary to protect our property or rights, or those of third parties or the public at large.
In complying with court orders and similar legal processes, Circle Weaver Tech strives for transparency. When permitted, we will make a reasonable effort to notify users of any disclosure of their information, unless we are prohibited by law or court order from doing so, or in rare, exigent circumstances.
We offer you simple methods of accessing and correcting the User Personal Information we have collected. You can change what you have provided for name at any time. To change email, you will need to create a new account under the new email address.
Any user may have their personal information removed from the system by making a written request to Circle Weaver Tech LLC and include the specific email address of the account you wish purged.


Barbara Morgenstern was admitted to practice in North Carolina in 1986, after receiving a Bachelor's Degree in 1977 in Spanish from Indiana University, and her J.D. degree from the University of North Carolina School of Law in 1986.
Before forming her own firm in 1993, Ms. Morgenstern was an associate with the law firm of Hill, Evans, Jordan & Beatty, P.L.L.C. in Greensboro, North Carolina. She currently practices in Guilford County. Ms. Morgenstern's practice is limited solely to family law. She was certified as a specialist in family law by the North Carolina State Bar in 1991.
Ms. Morgenstern has served as chair of the Family Law Section of the North Carolina Bar Association. She has served on various committees of the Family Law Section and currently serves as a member of the Curriculum and Alternate Dispute Resolution committees of the North Carolina Family Law Section.
Ms. Morgenstern is a frequent speaker at continuing legal education seminars sponsored by such providers as the North Carolina Bar Foundation, UNC Law School, and Wake Forest University School of Law. She has also served an adjunct professor of family law at Elon University School of law and as a guest lecturer at the University of North Carolina School of Law.
Ms. Morgenstern has written and presented on a wide range of topics, including custody, child support, alimony, equitable distribution, valuation of professional licenses and degrees, proving income and depression of income, reconciliation agreements, the Model Relocation Act, ethics, and deposition techniques. Ms. Morgenstern is certified as an arbitrator by the American Academy of Matrimonial Lawyers and spends a substantial amount of her time conducting mediations. She currently serves as Treasurer of the North Carolina Chapter of the American Academy of Matrimonial Lawyers.
Ms. Morgenstern has been listed in the Family Law Section of Best Lawyers in America since 1997, and was recently named Best Family Lawyer in Greensboro by Best Lawyers in America.
Melanie Y. Crenshaw was admitted to practice in North Carolina in 2009, after receiving a Bachelor’s Degree in French summa cum laude in 1998 from Elon University, and her J.D. Degree summa cum laude from the Elon University School of Law in 2009. Ms. Crenshaw is a member of the North Carolina Bar Association and the Greensboro Bar Association.
During law school, Ms. Crenshaw served as the Symposium Editor for the Elon Law Review and as a member of the Elon Law Moot Court Board. Ms. Crenshaw competed at the University of North Carolina-Chapel Hill Craven Moot Court Competition where her team placed second and at the Regent University National Constitutional Law Moot Court Competition where her team received the second place brief award. From 2007 to 2009, Ms. Crenshaw served as the clerk for the Criminal Subcommittee of the North Carolina Pattern Jury Instructions Committee.
Before entering law school, Ms. Crenshaw taught French at a high school in Fayetteville, North Carolina, for seven years. She also coached the school’s speech and debate team.
Ms. Crenshaw is involved in the Greensboro community through her volunteer activities with United Way Young Leaders, as a tutor for Reading Connections and as a member of the Choral Society of Greensboro. Ms. Crenshaw is also trained as a presenter for the Family Life Council’s Parenting Under Two Roofs.