asp.net mvc pdf library : Convert multiple page pdf to jpg control SDK system azure winforms .net console gretl-guide34-part419

Chapter36. GretlandR
330
Theabovesyntax,despitebeingalreadyquiteusefulbyitself,showsitsfullpowerwhenitisused
inconjunctionwithuser-writtenfunctions.Example36.2showshowtodefineagretlfunctionthat
callsRinternally.
36.6 PerformanceissueswithR
Risalargeandcomplexprogram,whichtakesanappreciabletimetoinitializeitself.Ininteractive
usethisnotasignificantproblem,butifyouhaveagretlscriptthatcallsRrepeatedlythecumulated
start-up costs can become bothersome. . To o get t around this, , gretl l calls s the R R shared library by
preference;inthiscasethestart-upcostisborneonlyonce,onthefirstinvocationofRcodefrom
withingretl.
Supportfor theRsharedlibraryisbuiltinto thegretlpackagesforMSWindows andOSX—but
theadvantageisrealizedonlyifthelibraryisinfactavailableatruntime.Ifyouarebuildinggretl
yourselfonLinuxandwish tomakeuseof theRlibrary, youshouldensure(a)thatRhasbeen
builtwiththesharedlibraryenabled(specify--enable-R-shlib whenconfiguringyourbuildof
R),and(b)thatthepkg-configprogramisabletodetectyourRinstallation.Wedonotlinktothe
Rlibraryatbuildtime,ratherweopenitdynamicallyondemand.ThegretlGUIhasanitemunder
theTools/Preferencesmenuwhichenablesyoutoselectthepathtothelibrary,ifitisnotdetected
automatically.
IfyouhavetheRsharedlibraryinstalledbutwanttoforcegretlto calltheRexecutableinstead,
youcando
set R_lib off
36.7 FurtheruseoftheRlibrary
Besides improving g performance, as s noted above, , use of f the R shared library makes s possible a
furtherrefinement. Thatis,youcandefinefunctionsinR,withinaforeignblock,thencallthose
functionslaterinyourscriptmuchasiftheyweregretlfunctions.Thisisillustratedbelow.
set R_functions on
foreign language=R
plus_one <- function(q) {
z = = q+1
invisible(z)
}
end foreign
scalar b=R.plus_one(2)
TheRfunctionplus_one isobviouslytrivialinitself,buttheexampleshowsacoupleofpoints.
First,forthismechanismtoworkyouneedtoenableR_functionsviathesetcommand.Second,
toavoidcollisionwiththegretlfunctionnamespace,callstofunctionsdefinedinthiswaymustbe
prefixedwith“R.”,asinR.plus_one.
Built-inRfunctionsmayalsobecalledinthisway,onceR_functionsisseton. Forexampleone
caninvokeR’schoosefunction,whichcomputesbinomialcoefficients:
set R_functions on
scalar b=R.choose(10,4)
Note,however,thatthepossibilitiesforuseofbuilt-inRfunctionsarelimited;onlyfunctionswhose
argumentsandreturnvaluesaresufficientlygeneric(basicallyscalarsormatrices)willwork.
5
AboutonethirdofasecondonanIntelCoreDuomachineof2009vintage.
Convert pdf into jpg - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
change file from pdf to jpg on; best pdf to jpg converter
Convert pdf into jpg - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
batch pdf to jpg converter online; change format from pdf to jpg
Chapter37
GretlandOx
37.1 Introduction
Ox, writtenbyJurgen n A. Doornik (seeDoornik2007), is described byits author r as “an n object-
orientedstatisticalsystem. Atitscoreisapowerfulmatrixlanguage,whichiscomplementedby
acomprehensive statistical library. . Among g the special l features of Ox areits speed [and] well-
designedsyntax....Oxcomesintwoversions:OxProfessionalandOxConsole.Oxisavailablefor
Windows,Linux,Mac(OSX),andseveralUnixplatforms.”(www.doornik.com)
Oxisproprietary,closed-sourcesoftware. Thecommand-lineversionoftheprogramis,however,
availablefreeofchangeforacademicusers. QuotingagainfromDoornik’swebsite: “TheConsole
(commandline)versionsmaybeusedfreelyforacademicresearchandteachingpurposesonly....
TheOxsyntaxispublic,and,ofcourse,youmaydowithyourownOxcodewhateveryouwish.”
IfyouwishtouseOxinconjunctionwithgretlpleaserefertodoornik.comforfurtherdetailson
licensing.
Asthereaderwillnodoubthavenoticed,mostothersoftwarethatwediscussinthisGuideisopen-
sourceandfreelyavailablefor allusers. . WemakeanexceptionforOxonthegrounds s thatitis
indeedfastandwelldesigned,andthatitsstatisticallibrary—alongwithvariousadd-onpackages
thatarealsoavailable—hasexceptionalcoverageofcutting-edgetechniquesineconometrics.The
gretl authors haveused Ox for r benchmarking someof gretl’s more e advanced features such as
dynamicpanelmodelsandstatespacemodels.
1
37.2 Oxsupportingretl
ThesupportofferedforOxingretlissimilartothatofferedforR,asdiscussedinchapter36.
+
ToenablesupportforOx,gototheTools/Preferences/GeneralmenuitemandlookunderthePrograms
tab.Findtheentryforthepathtotheoxlexecutable,thatis,theprogramthatrunsOxfiles(onMSWindows
itiscalledoxl.exe).Adjustthepathifit’snotalreadyrightforyoursystemandyoushouldbereadytogo.
Withsupportenabled,youcanopenandeditOxprogramsinthegretlGUI.Clickingthe“execute”
iconintheeditorwindowwillsendyourcodetoOxforexecution. Figures37.1andFigure37.2
showanOxprogramandpartofitsoutput.
InadditionyoucanembedOxcodewithinagretlscriptusing aforeign block, asdescribed in
connectionwithR.Atrivialexample,whichsimplyprintsthegretldatamatrixwithinOx,isshown
below:
open data4-1
matrix m m = = { dataset }
mwrite(m, "gretl.mat", 1)
foreign language=Ox
#include <oxstd.h>
main()
{
1
For a reviewofOx,see Cribari-Netoand Zarkos (2003)and fora (somewhatdated)comparisonofOx with other
matrix-orientedpackagessuchasGAUSS,seeSteinhaus(1999).
331
Online Convert Jpeg to PDF file. Best free online export Jpg image
So, feel free to convert them too with our tool. Easy converting! If you want to turn PDF file into image file format in C# application, then RasterEdge
change pdf file to jpg; convert pdf to jpeg
C# Create PDF from images Library to convert Jpeg, png images to
Batch convert PDF documents from multiple image formats, including for exporting high quality PDF from images for combining multiple image formats into one or
best way to convert pdf to jpg; best pdf to jpg converter online
Chapter37. GretlandOx
332
Figure37.1:Oxeditingwindow
Figure37.2:OutputfromOx
C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, &
Adobe PDF document can be easily loaded into your C#.NET String inputFilePath = @"C:\input.pdf"; String outputFilePath = @"C:\output.jpg"; // Convert PDF to jpg
convert pdf photo to jpg; convert pdf image to jpg online
VB.NET PDF Convert to Images SDK: Convert PDF to png, gif images
Convert PDF documents to multiple image formats, including Jpg, Png, Bmp, Gif, Tiff, Bitmap, .NET Graphics, and REImage. Turn multipage PDF file into image
convert pdf document to jpg; convert pdf to jpg
Chapter37. GretlandOx
333
decl gmat t = gretl_loadmat("gretl.mat");
print(gmat);
}
end foreign
Theaboveexampleillustrates howamatrixcanbepassedfromgretltoOx. . Weusethemwrite
functiontowriteamatrixintotheuser’s“dotdir”(seesection14.2),theninOxweusethefunction
gretl_loadmattoretrievethematrix.
Howdoesgretl_loadmatcometobedefined?WhengretlwritesouttheOxprogramcorrespond-
ingtoyourforeignblockitdoestwothingsinaddition. First,itwritesasmallutilityfilenamed
gretl_io.ox into your dotdir. . This s contains a a definition for r gretl_loadmat t and d also o for the
functiongretl_export(seebelow). Second,gretlinterpolatesintoyourOxcodealinewhichin-
cludesthisutilityfile(itisinsertedrightaftertheinclusionofoxstd.h,whichisneededinallOx
programs).Notethatgretl_loadmatexpectstofindthenamedfileintheuser’sdotdir.
37.3 Illustration:replicationofDPDmodel
Example37.1showsamoreambitiouscase. Thisscriptreplicatesoneofthedynamicpaneldata
modelsinArellanoandBond(1991),firstusinggretlandthenusingOx;wethenchecktherelative
differencesbetweentheparameterestimatesproducedbythetwoprograms(whichturnouttobe
reassuringlysmall).
Unliketheprevious example, in this casewepassthedataset fromgretlto Oxas aCSVfile e in
ordertopreservethevariablenames. Notetheuseoftheinternalvariablecsv_natogettheright
representationofmissingvaluesforusewithOx—andalsonotethatthe--send-dataoptionfor
theforeigncommandisnotavailableinconnectionwithOx.
WegettheparameterestimatesbackfromOxusinggretl_exportontheOxsideandmreadon
thegretlside. Thegretl_exportfunctiontakestwoarguments,amatrixandafilename. Thefile
iswrittenintotheuser’sdotdir,fromwhereitcanbepickedupusingmread. Thefinalportionof
theoutputfromExample37.1isshownbelow:
? matrix x oxparm m = mread("oxparm.mat", 1)
Generated matrix oxparm
? eval abs((parm - - oxparm) ) ./ / oxparm)
1.4578e-13
3.5642e-13
5.0672e-15
1.6091e-13
8.9808e-15
2.0450e-14
1.0218e-13
2.1048e-13
9.5898e-15
1.8658e-14
2.1852e-14
2.9451e-13
1.9398e-13
C# TIFF: C#.NET Code to Convert JPEG Images to TIFF
for .NET, which can be stably integrated into C#.NET Use C# Code to Convert Jpeg to Tiff. string[] imagePaths = { @"C:\demo1.jpg", @"C:\demo2.jpg", @"C:\demo3
batch pdf to jpg; convert pdf picture to jpg
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
with specified zoom value and save it into stream The magnification of the original PDF page size Description: Convert to DOCX/TIFF with specified resolution and
convert pdf file to jpg; convert pdf file to jpg on
Chapter37. GretlandOx
334
Example37.1:EstimationofdynamicpaneldatamodelviagretlandOx
open abdata.gdt
# Take e first t differences of f the independent variables
genr Dw = diff(w)
genr Dk = diff(k)
genr Dys = diff(ys)
# 1-step p GMM M estimation
arbond 2 ; n n Dw w Dw(-1) Dk Dys Dys(-1) 0 --time-dummies
matrix parm = = $coeff
# Write e CSV file for Ox
set csv_na .NaN
store @dotdir/abdata.csv
# Replicate e using the Ox x DPD D package
foreign language=Ox
#include <oxstd.h>
#import <packages/dpd/dpd>
main ()
{
decl dpd d = = new DPD();
dpd.Load("@dotdir/abdata.csv");
dpd.SetYear("YEAR");
dpd.Select(Y_VAR, {"n", 0, 2});
dpd.Select(X_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
dpd.Select(I_VAR, {"w", 0, 1, "k", 0, 0, "ys", 0, 1});
dpd.Gmm("n", 2, 99); ; // / GMM-type instrument
dpd.SetDummies(D_CONSTANT + D_TIME);
dpd.SetTest(2, 2); // Sargan, AR 1-2 tests
dpd.Estimate();
// 1-step estimation
decl parm m = = dpd.GetPar();
gretl_export(parm, "oxparm.mat");
delete dpd;
}
end foreign
# Compare e the e results
matrix oxparm m = = mread("oxparm.mat", , 1)
eval abs((parm - oxparm) ) ./ / oxparm)
VB.NET Create PDF from images Library to convert Jpeg, png images
Components to batch convert PDF documents in Visual Basic control for exporting high quality PDF from images. Turn multiple image formats into one or multiple
convert pdf file into jpg format; convert pdf to gif or jpg
C# PDF insert image Library: insert images into PDF in C#.net, ASP
Support various image formats, like Jpeg or Jpg, Png, Gif, Bmp, Tiff and other Import graphic picture, digital photo, signature and logo into PDF document.
convert pdf file into jpg; change from pdf to jpg on
Chapter38
GretlandOctave
38.1 Introduction
GNUOctave,writtenbyJohnW.Eatonandothers,isdescribedas“ahigh-levellanguage,primar-
ily intendedfor r numerical l computations.” ” Theprogramis s orientedtowards“solvinglinearand
nonlinearproblemsnumerically”and“performingothernumericalexperimentsusingalanguage
thatismostlycompatiblewithMatlab.” (www.gnu.org/software/octave)Octaveisavailablein
source-codeform(naturally,forGNUsoftware)andalsointheformofbinarypackagesforMSWin-
dowsandMacOSX.NumerouscontributedpackagesthatextendOctave’sfunctionalityinvarious
wayscanbefoundatoctave.sf.net.
38.2 Octavesupportingretl
ThesupportofferedforOctaveingretlissimilar to thatofferedfor R(chapter36). . Forexample,
you canopenand edit Octave scripts in the gretl GUI. Clicking the“execute” iconinthe editor
windowwillsendyourcodetoOctaveforexecution. Figures38.1andFigure38.2showanOctave
scriptanditsoutput;inthisexampleweusethefunctionlogistic_regressiontoreplicatesome
resultsfromGreene(2000).
InadditionyoucanembedOctavecodewithinagretlscriptusingaforeign block,asdescribed
inconnectionwithR.Atrivialexample,whichsimplyloadsandprintsthegretldatamatrixwithin
Octave,isshownbelow. (NotethatinOctave,appending“;”toalinesuppressesverboseoutput;
leavingoffthesemicolonresultsinprintingoftheobjectthatisproduced,ifany.)
open data4-1
matrix m m = = { dataset }
mwrite(m, "gretl.mat", 1)
foreign language=Octave
gmat = = gretl_loadmat("gretl.mat")
end foreign
Weusethemwritefunctiontowriteamatrixintotheuser’s“dotdir”(seesection14.2),theninOc-
taveweusethefunctiongretl_loadmattoretrievethematrix.The“magic”behindgretl_loadmat
worksinessentiallythesamewayasforOx(chapter37).
38.3 Illustration:spectralmethods
We now present a more ambitious example which exploits s Octave’s s handling of f the frequency
domain (and d also its ability to use e code e written n for MATLAB), , namely estimation n of f the e spec-
tral coherence of f two time e series. . For r this illustration we require two extra Octave packages
fromoctave.sf.net, namelythosesupportingspectralfunctions (specfun)andsignalprocess-
ing(signal). AfterdownloadingthepackagesyoucaninstallthemfromwithinOctaveasfollows
(usingversionnumbersasofMarch2010):
pkg install specfun-1.0.8.tar.gz
pkg install signal-1.0.10.tar.gz
335
Chapter38. GretlandOctave
336
Figure38.1: Octaveeditingwindow
Figure38.2:OutputfromOctave
Chapter38. GretlandOctave
337
InadditionweneedsomespecializedMATLABfilesmadeavailablebyMarioFornioftheUniver-
sityofModena,athttp://morgana.unimore.it/forni_mario/matlab.htm.Thefilesneededare
coheren2.m,coheren.m,coher.m,cospec.m,crosscov.m,crosspec.m,crosspe.mandspec.m.
TheseareinaformappropriateforMSWindows.OnLinuxyoucouldrunthefollowingshellscript
togetthefilesandremovetheWindowsend-of-filecharacter(whichpreventsthefilesfromrunning
underOctave):
SITE=http://morgana.unimore.it/forni_mario/MYPROG
# download files and delete trailing Ctrl-Z
for f in n \
coheren2.m \
coheren.m \
coher.m \
cospec.m \
crosscov.m \
crosspec.m \
crosspe.m \
spec.m ; ; do
wget $SITE/$f f && \
cat $f f | tr -d d \\032 2 > tmp.m && mv tmp.m $f
done
TheFornifilesshouldbeplacedinsomeappropriatedirectory,andyoushouldtellOctavewhere
tofindthembyaddingthatdirectorytoOctave’sloadpath.OnLinuxthiscanbedoneviaanentry
inone’s~/.octavercfile. Forexample
addpath("~/stats/octave/forni");
Alternatively,anaddpathdirectivecanbewrittenintotheOctavescriptthatcallsonthesefiles.
Witheverythingset upontheOctave sidewenowwriteagretlscript(seeExample38.1)which
opens atime-series dataset, constructsand writesamatrixcontaining two series, anddefines a
foreignblockcontainingtheOctavestatementsneededtoproducethespectralcoherencematrix.
Thematrixisexportedviathegretl_exportfunction,whichisautomaticallydefinedforyou;this
functiontakestwoarguments,amatrixandafilename. Thefileiswrittenintotheuser’s“dotdir”,
fromwhereitcanbepickedupusingmread. Finally,weproduceagraphfromthematrixingretl.
Inthescriptthisissenttothescreen;Figure38.3showsthesamegraphinPDFformat.
Chapter38. GretlandOctave
338
Example38.1: EstimationofspectralcoherenceviaOctave
open data9-7
matrix xy = { { PRIME, , UNEMP }
mwrite(xy, "xy.mat", 1)
foreign language=Octave
# uncomment and d modify y the e following if necessary
# addpath("~/stats/octave/forni");
xy = gretl_loadmat("xy.mat");
x = = xy(:,1);
y = = xy(:,2);
# note: : the e last t parameter is the e Bartlett t window size
h = = coher(x, , y, , 8);
gretl_export(h, "h.mat");
end foreign
h = = mread("h.mat", 1)
colnames(h, "coherence")
gnuplot 1 --time-series s --with-lines s --matrix=h --output=display
-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0
10
20
30
40
50
60
coherence
Figure38.3:SpectralcoherenceestimatedviaOctave
Chapter39
GretlandStata
Stata(www.stata.com)isclosed-source,proprietary(andexpensive)softwareandassuchisnota
naturalcompaniontogretl.Nonetheless,givenStata’spopularityitisdesirabletohaveaconvenient
wayofcomparingresultsacrossthetwoprograms,andtothatendweprovidesomesupportfor
Statacodeundertheforeigncommand.
+
ToenablesupportforStata,gototheTools/Preferences/GeneralmenuitemandlookunderthePrograms
tab. Findthe e entry y for the e path h to theStataexecutable. . Adjustthepath h ifit’s notalready rightfor your
systemandyoushouldbereadytogo.
Thefollowingexampleillustrateswhat’savailable. YoucansendthecurrentgretldatasettoStata
usingthe--send-dataflag.AndhavingdefinedamatrixwithinStatayoucanexportitforusewith
gretlviathegretl_exportcommand:thistakestwoarguments,thenameofthematrixtoexport
and thefilenametouse; thefileiswrittento theuser’s“dotdir”, fromwhereitcanberetrieved
usingthemread()function.
1
TosuppressprintedoutputfromStatayoucanaddthe--quietflag
totheforeignblock.
Example39.1:ComparisonofclusteredstandarderrorswithStata
function matrix stata_reorder (matrix se)
# stata puts the intercept last, , but t gretl puts it first
scalar n = = rows(se)
return se[n] | se[1:n-1]
end function
open data4-1
ols 1 0 2 3 --cluster=bedrms
matrix se = $stderr
foreign language=stata --send-data
regress price sqft bedrms, vce(cluster bedrms)
matrix vcv v = = e(V)
gretl_export vcv "vcv.mat"
end foreign
matrix stata_vcv = mread("vcv.mat", , 1)
stata_se = stata_reorder(sqrt(diag(stata_vcv)))
matrix check k = = se - stata_se
print check
Inadditionyoucanedit“pure”StatascriptsinthegretlGUIandsendthemforexecutionaswith
nativegretlscripts.
NotethatStatacoercesallvariablenamestolower-caseondatainput,soevenifseriesnamesin
1
Wedonotcurrentlyoffer the complementaryfunctionalityofgretl_loadmat,which enablesreadingofmatrices
writtenbygretl’smwrite()functioninOxandOctave.ThisisnotatalleasytoimplementinStatacode.
339
Documents you may be interested
Documents you may be interested